langchain/libs/partners/fireworks/tests/integration_tests/test_embeddings.py
Yufei (Benny) Chen ee6a773456
fireworks[patch]: Add Fireworks partner packages (#17694)
---------

Co-authored-by: Erick Friis <erick@langchain.dev>
2024-02-23 20:45:47 +00:00

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