Embeddings API Documentation needs to updated

Currently it says:

def get_embedding(text, model="text-embedding-ada-002"):
   text = text.replace("\n", " ")
   return client.embeddings.create(input = [text], model=model)['data'][0]['embedding']

Correct version for me:

client.embeddings.create(input = [text], model=model).data[0].embedding

2 Likes

Also seems like the lib “openai.embeddings_utils” has been deleted…

1 Like