Skip to content

Commit cc3e2d1

Browse files
committed
fix schema
1 parent a8c330e commit cc3e2d1

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-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/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)