Bug-Fix[Community] Fix FastEmbedEmbeddings (#26764)

#26759 

- Fix https://github.com/langchain-ai/langchain/issues/26759 
- Change `model` param from private to public, which may not be
initiated.
- Add test case
This commit is contained in:
ZhangShenao
2024-10-01 09:23:08 +08:00
committed by GitHub
parent a8e1577f85
commit e317d457cf
2 changed files with 13 additions and 5 deletions

View File

@@ -80,3 +80,11 @@ async def test_fastembed_async_embedding_query(
embedding = FastEmbedEmbeddings(model_name=model_name, max_length=max_length) # type: ignore[call-arg]
output = await embedding.aembed_query(document)
assert len(output) == 384
def test_fastembed_embedding_query_with_default_params() -> None:
"""Test fastembed embeddings for query with default model params"""
document = "foo bar"
embedding = FastEmbedEmbeddings() # type: ignore[call-arg]
output = embedding.embed_query(document)
assert len(output) == 384