forked from phoenix/litellm-mirror
fix(utils.py): fix reordering of items for cached embeddings
ensures cached embedding item is returned in correct order
This commit is contained in:
parent
28e4706bfd
commit
48bfc45cb0
3 changed files with 53 additions and 1 deletions
|
@ -3174,7 +3174,13 @@ def client(original_function):
|
|||
for val in non_null_list:
|
||||
idx, cr = val # (idx, cr) tuple
|
||||
if cr is not None:
|
||||
final_embedding_cached_response.data[idx] = cr
|
||||
final_embedding_cached_response.data[idx] = (
|
||||
Embedding(
|
||||
embedding=cr["embedding"],
|
||||
index=idx,
|
||||
object="embedding",
|
||||
)
|
||||
)
|
||||
if len(remaining_list) == 0:
|
||||
# LOG SUCCESS
|
||||
cache_hit = True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue