Azure / azure-sdk-for-net

This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
MIT License
5.37k stars 4.79k forks source link

[FEATURE REQ] Support OpenAI GPT-4 Vision API #39780

Closed kirk-marple closed 3 months ago

kirk-marple commented 11 months ago

Library name

Azure.AI.OpenAI

Please describe the feature.

Saw that 1.0.0-beta.9 just dropped, and was looking for support for GPT-4 Vision.

I searched issues, and don't see anything else tracking this.

Do you expect to support the new 'content' syntax for providing image URLs to the model?

ChatMessage only takes a string for Content right now, it appears.

https://platform.openai.com/docs/guides/vision

For example:

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
  }'
scottaddie commented 3 months ago

The Vision API is already supported. See https://github.com/openai/openai-dotnet/blob/main/examples/Assistants/Example05_AssistantsWithVision.cs. Also, the image URL syntax is supported in Azure.AI.OpenAI v1.0.0-beta.17 and later. See the changelog entry at https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/openai/Azure.AI.OpenAI/CHANGELOG.md#features-added-3.

github-actions[bot] commented 3 months ago

Hi @kirk-marple. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text "/unresolve" to remove the "issue-addressed" label and continue the conversation.

kirk-marple commented 3 months ago

This issue was from 8 months ago :) We are using the API for it now, appreciate the team getting it supported.