The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
huggingface: fix embeddings return type (#31072)
ccurmebdb7c4a8b303
diff --git a/libs/partners/huggingface/langchain_huggingface/embeddings/huggingface_endpoint.py b/libs/partners/huggingface/langchain_huggingface/embeddings/huggingface_endpoint.pyindex 067b02434e..afd19f9a8c 100644--- a/libs/partners/huggingface/langchain_huggingface/embeddings/huggingface_endpoint.py+++ b/libs/partners/huggingface/langchain_huggingface/embeddings/huggingface_endpoint.py@@ -115,7 +115,7 @@ class HuggingFaceEndpointEmbeddings(BaseModel, Embeddings):_model_kwargs = self.model_kwargs or {}# api doc: https://huggingface.github.io/text-embeddings-inference/#/Text%20Embeddings%20Inference/embedresponses = self.client.feature_extraction(text=texts, **_model_kwargs)- return responses+ return responses.tolist()async def aembed_documents(self, texts: list[str]) -> list[list[float]]:"""Async Call to HuggingFaceHub's embedding endpoint for embedding search docs.@@ -132,7 +132,7 @@ class HuggingFaceEndpointEmbeddings(BaseModel, Embeddings):responses = await self.async_client.feature_extraction(text=texts, **_model_kwargs)- return responses+ return responses.tolist()def embed_query(self, text: str) -> list[float]:"""Call out to HuggingFaceHub's embedding endpoint for embedding query text.