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: The type in OpenAIChatCompletionChoiceMessageContentItemModel.im… #144

Merged
merged 1 commit into from
Feb 21, 2024

Conversation

zmhu
Copy link
Contributor

@zmhu zmhu commented Dec 19, 2023

The type in OpenAIChatCompletionChoiceMessageContentItemModel.imageUrl() should be "image_url".

api docs: https://platform.openai.com/docs/api-reference/chat/create

curl https://api.openai.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -d '{
    "model": "gpt-4-vision-preview",
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "type": "text",
            "text": "What’s in this image?"
          },
          {
            "type": "image_url",
            "image_url": {
              "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"
            }
          }
        ]
      }
    ],
    "max_tokens": 300
  }'

@marc-wilson
Copy link

marc-wilson commented Feb 1, 2024

@zmhu @anasfik can we merge this? Can't get anything to work with imageUrl so I'm assuming this is the fix.

@marc-wilson marc-wilson mentioned this pull request Feb 1, 2024
@anasfik anasfik merged commit bd532e7 into anasfik:main Feb 21, 2024
@anasfik
Copy link
Owner

anasfik commented Feb 21, 2024

Thank you, this is merged.

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.

3 participants