Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CreateEmbeddingResponse object type #112

Merged
merged 1 commit into from
Nov 8, 2023

Conversation

davidmigloz
Copy link
Contributor

The current object is set embedding but the API returns list instead.

Example:

curl https://api.openai.com/v1/embeddings \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "The food was delicious and the waiter...",
    "model": "text-embedding-ada-002",
    "encoding_format": "float"
  }'

Response:

{
  "object": "list",
  "data": [
    {
      "object": "embedding",
      "index": 0,
      "embedding": [ 0.0022579778, ...]
    }
  ],
  "model": "text-embedding-ada-002-v2",
  "usage": {
    "prompt_tokens": 8,
    "total_tokens": 8
  }
}

cc @schnerd

Copy link
Collaborator

@schnerd schnerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@schnerd schnerd enabled auto-merge November 8, 2023 17:56
@schnerd schnerd merged commit 2a11b83 into openai:master Nov 8, 2023
1 check passed
@davidmigloz davidmigloz deleted the embedding-object branch November 9, 2023 15:18
@davidmigloz davidmigloz mentioned this pull request Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants