Skip to content

Commit 5f1c46b

Browse files
committed
don't know how to pass type validation
1 parent 3ac510a commit 5f1c46b

File tree

1 file changed

+4
-2
lines changed
  • libs/community/langchain_community/embeddings

1 file changed

+4
-2
lines changed

libs/community/langchain_community/embeddings/localai.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,13 @@ async def wrapped_f(*args: Any, **kwargs: Any) -> Callable:
8989

9090

9191
# https://stackoverflow.com/questions/76469415/getting-embeddings-of-length-1-from-langchain-openaiembeddings
92-
def _check_response(response: dict) -> dict:
92+
def _check_response(response: Any) -> Any:
9393
if any(len(d.embedding) == 1 for d in response.data):
9494
import openai
9595

96-
raise openai.APIError("LocalAI API returned an empty embedding")
96+
raise openai.APIError(
97+
"LocalAI API returned an empty embedding", None, body=None
98+
)
9799
return response
98100

99101

0 commit comments

Comments
 (0)