We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3ac510a commit 5f1c46bCopy full SHA for 5f1c46b
libs/community/langchain_community/embeddings/localai.py
@@ -89,11 +89,13 @@ async def wrapped_f(*args: Any, **kwargs: Any) -> Callable:
89
90
91
# https://stackoverflow.com/questions/76469415/getting-embeddings-of-length-1-from-langchain-openaiembeddings
92
-def _check_response(response: dict) -> dict:
+def _check_response(response: Any) -> Any:
93
if any(len(d.embedding) == 1 for d in response.data):
94
import openai
95
96
- raise openai.APIError("LocalAI API returned an empty embedding")
+ raise openai.APIError(
97
+ "LocalAI API returned an empty embedding", None, body=None
98
+ )
99
return response
100
101
0 commit comments