mirror of
https://github.com/hwchase17/langchain
synced 2024-11-10 01:10:59 +00:00
ee6a773456
--------- Co-authored-by: Erick Friis <erick@langchain.dev>
21 lines
690 B
Python
21 lines
690 B
Python
"""Test Fireworks embeddings."""
|
|
|
|
from langchain_fireworks.embeddings import FireworksEmbeddings
|
|
|
|
|
|
def test_langchain_fireworks_embedding_documents() -> None:
|
|
"""Test Fireworks hosted embeddings."""
|
|
documents = ["foo bar"]
|
|
embedding = FireworksEmbeddings(model="nomic-ai/nomic-embed-text-v1.5")
|
|
output = embedding.embed_documents(documents)
|
|
assert len(output) == 1
|
|
assert len(output[0]) > 0
|
|
|
|
|
|
def test_langchain_fireworks_embedding_query() -> None:
|
|
"""Test Fireworks hosted embeddings."""
|
|
document = "foo bar"
|
|
embedding = FireworksEmbeddings(model="nomic-ai/nomic-embed-text-v1.5")
|
|
output = embedding.embed_query(document)
|
|
assert len(output) > 0
|