Merge pull request #1928 from danielaskdd/main

Fix: Update OpenAI embedding handling for both list and base64 embeddings
This commit is contained in:
Daniel.y 2025-08-09 08:44:21 +08:00 committed by GitHub
commit f1c6a4ed94
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

1
.gitignore vendored
View file

@ -70,4 +70,5 @@ gui/
test_*
# Cline files
memory-bank
memory-bank/

View file

@ -477,7 +477,9 @@ async def openai_embed(
)
return np.array(
[
np.frombuffer(base64.b64decode(dp.embedding), dtype=np.float32)
np.array(dp.embedding, dtype=np.float32)
if isinstance(dp.embedding, list)
else np.frombuffer(base64.b64decode(dp.embedding), dtype=np.float32)
for dp in response.data
]
)