-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Looking over the code related to embeddings, I've noticed:
openai-python/openai/embeddings_utils.py
Lines 48 to 49 in c556584
data = openai.Embedding.create(input=list_of_text, engine=engine, **kwargs).data | |
data = sorted(data, key=lambda x: x["index"]) # maintain the same order as input. |
Which I have not seen in the API documentation (or other examples), tho I may have missed it. Should the user expect that the order of returned batched embeddings from the API may not be deterministic and thus not be in the same order as input data?
To Reproduce
get_embeddings(["foo bar", "foo baz"])
Code snippets
No response
OS
macOS
Python version
python 3.10
Library version
0.27.4
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working