Why is Openai Embeddings API returning multiple vectors for one very long string?

I am using the Embeddings API. I am using the text-embedding-ada-002 model, which has a max token length of 8191. My string is much shorter, only 3000 characters, but it is still returning multiple embedding vectors for that one string. What is going on here?

Welcome to the forum!

Can you please show your code and output, trying to work out if you are seeing the contents of a single embedding, which is a multi dimensional array, or actually many embeddings returned.

1 Like

It has to do with one of the quirks of Langchain. I was doing embeddings.embed(text) when I should have been doing embeddings.embed([text])

1 Like