Skip to content

Commit

Permalink
Fix text embedding
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianloose committed Feb 28, 2025
1 parent 8624512 commit 9ac4624
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions app/llm/external/openai_embeddings.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,7 @@ def embed(self, text: str) -> list[float]:

for attempt in range(retries):
try:
response = self._client.embeddings.create(
model=self.model,
input=text,
encoding_format="float",
)
return response.data[0].embedding
return self._client.embed_query(text)
except (
APIError,
APITimeoutError,
Expand Down

0 comments on commit 9ac4624

Please sign in to comment.