Skip to content

Commit 5c25fd4

Browse files
Merge pull request #261037 from PatrickFarley/openai-gptnext
fix schema
2 parents e8b711c + 1e316ec commit 5c25fd4

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

articles/ai-services/openai/how-to/gpt-with-vision.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ The following is a sample request body. The format is the same as the chat compl
4848
{
4949
"role": "user",
5050
"content": [
51-
"Describe this picture:", { "image": "URL or base-64-encoded image" }
52-
]
51+
{ "type": "text", "text": "Describe this picture:" },
52+
{ "type": "image_url", "url": "<URL or base-64-encoded image>" }
53+
]
5354
}
5455
],
5556
"max_tokens": 100,
@@ -154,8 +155,9 @@ You must also include the `enhancements` and `dataSources` objects. `enhancement
154155
{
155156
"role": "user",
156157
"content": [
157-
"Describe this picture:", { "image": "URL or base-64-encoded image" }
158-
]
158+
{ "type": "text", "text": "Describe this picture:" },
159+
{ "type": "image_url", "url": "<URL or base-64-encoded image>" }
160+
]
159161
}
160162
],
161163
"max_tokens": 100,

articles/ai-services/openai/includes/gpt-v-studio.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Start exploring GPT-4 Turbo with Vision capabilities with a no-code approach thr
1717
- An Azure subscription. <a href="https://azure.microsoft.com/free/ai-services" target="_blank">Create one for free</a>.
1818
- Access granted to Azure OpenAI in the desired Azure subscription. Currently, access to this service is granted only by application. You can apply for access to Azure OpenAI by completing the form at https://aka.ms/oai/access. Open an issue on this repo to contact us if you have an issue.
1919
- An Azure OpenAI Service resource. The resource must be in the `SwitzerlandNorth`, `SwedenCentral`, `WestUS`, or `AustraliaEast` Azure region. For more information about resource creation, see the [resource deployment guide](/azure/ai-services/openai/how-to/create-resource).
20+
- For Vision enhancement (optional): An Azure Computer Vision resource in the same region as your Azure OpenAI resource.
2021

2122

2223
## Go to Azure OpenAI Studio

articles/ai-services/openai/reference.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,15 +238,15 @@ curl https://YOUR_RESOURCE_NAME.openai.azure.com/openai/deployments/YOUR_DEPLOYM
238238
curl https://YOUR_RESOURCE_NAME.openai.azure.com/openai/deployments/YOUR_DEPLOYMENT_NAME/chat/completions?api-version=2023-12-01-preview \
239239
-H "Content-Type: application/json" \
240240
-H "api-key: YOUR_API_KEY" \
241-
-d '{"messages":[{"role":"system","content":"You are a helpful assistant."},{"role":"user","content":["Describe this picture:",{"image":"https://learn.microsoft.com/azure/ai-services/computer-vision/media/quickstarts/presentation.png"}]}]}'
241+
-d '{"messages":[{"role":"system","content":"You are a helpful assistant."},{"role":"user","content":[{"type":"text","text":"Describe this picture:"},{"type":"image_url","url":"https://learn.microsoft.com/azure/ai-services/computer-vision/media/quickstarts/presentation.png"}]}]}'
242242
```
243243

244244
**Enhanced chat with vision**
245245
```console
246-
curl https://YOUR_RESOURCE_NAME.openai.azure.com/openai/deployments/YOUR_DEPLOYMENT_NAME/chat/completions?api-version=2023-12-01-preview \
246+
curl https://YOUR_RESOURCE_NAME.openai.azure.com/openai/deployments/YOUR_DEPLOYMENT_NAME/extensions/chat/completions?api-version=2023-12-01-preview \
247247
-H "Content-Type: application/json" \
248248
-H "api-key: YOUR_API_KEY" \
249-
-d '{"enhancements":{"ocr":{"enabled":true},"grounding":{"enabled":true}},"dataSources":[{"type":"AzureComputerVision","parameters":{"endpoint":" <Computer Vision Resource Endpoint> ","key":"<Computer Vision Resource Key>"}}],"messages":[{"role":"system","content":"You are a helpful assistant."},{"role":"user","content":["Describe this picture:",{"image":"https://learn.microsoft.com/azure/ai-services/computer-vision/media/quickstarts/presentation.png"}]}]}'
249+
-d '{"enhancements":{"ocr":{"enabled":true},"grounding":{"enabled":true}},"dataSources":[{"type":"AzureComputerVision","parameters":{"endpoint":" <Computer Vision Resource Endpoint> ","key":"<Computer Vision Resource Key>"}}],"messages":[{"role":"system","content":"You are a helpful assistant."},{"role":"user","content":[{"type":"text","text":"Describe this picture:"},{"type":"image_url","url":"https://learn.microsoft.com/azure/ai-services/computer-vision/media/quickstarts/presentation.png"}]}]}'
250250
```
251251

252252
#### Example response

0 commit comments

Comments
 (0)