Skip to content

Commit 20fbc12

Browse files
Merge pull request #273579 from aahill/assistants-v2
assistants v2
2 parents 635d833 + 1aa98b0 commit 20fbc12

18 files changed

+621
-147
lines changed

articles/ai-services/openai/assistants-quickstart.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.custom: devx-track-python, devx-track-dotnet
88
ms.topic: quickstart
99
author: mrbullwinkle
1010
ms.author: mbullwin
11-
ms.date: 03/13/2024
11+
ms.date: 05/20/2024
1212
zone_pivot_groups: openai-quickstart-assistants
1313
recommendations: false
1414
---

articles/ai-services/openai/assistants-reference-messages.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ This article provides reference documentation for Python and REST for the new As
2121
## Create message
2222

2323
```http
24-
POST https://YOUR_RESOURCE_NAME.openai.azure.com/openai/threads/{thread_id}/messages?api-version=2024-02-15-preview
24+
POST https://YOUR_RESOURCE_NAME.openai.azure.com/openai/threads/{thread_id}/messages?api-version=2024-05-01-preview
2525
```
2626

2727
Create a message.
@@ -36,7 +36,7 @@ Create a message.
3636

3737
|Name | Type | Required | Description |
3838
|--- |--- |--- |--- |
39-
| `role` | string | Required | The role of the entity that is creating the message. Currently only user is supported.|
39+
| `role` | string | Required | The role of the entity that is creating the message. Can be `user` or `assistant`. `assistant` indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages. `assistant` indicates the message is generated by the assistant. Use this value to insert messages from the assistant into the conversation. |
4040
| `content` | string | Required | The content of the message. |
4141
| `file_ids` | array | Optional | A list of File IDs that the message should use. There can be a maximum of 10 files attached to a message. Useful for tools like retrieval and code_interpreter that can access and use files. |
4242
| `metadata` | map | Optional | Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maximum of 512 characters long. |
@@ -54,7 +54,7 @@ from openai import AzureOpenAI
5454

5555
client = AzureOpenAI(
5656
api_key=os.getenv("AZURE_OPENAI_API_KEY"),
57-
api_version="2024-02-15-preview",
57+
api_version="2024-05-01-preview",
5858
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT")
5959
)
6060

@@ -69,7 +69,7 @@ print(thread_message)
6969
# [REST](#tab/rest)
7070

7171
```console
72-
curl https://YOUR_RESOURCE_NAME.openai.azure.com/openai/threads/{thread_id}/messages?api-version=2024-02-15-preview \
72+
curl https://YOUR_RESOURCE_NAME.openai.azure.com/openai/threads/{thread_id}/messages?api-version=2024-05-01-preview \
7373
-H "api-key: $AZURE_OPENAI_API_KEY" \
7474
-H 'Content-Type: application/json' \
7575
-d '{
@@ -83,7 +83,7 @@ curl https://YOUR_RESOURCE_NAME.openai.azure.com/openai/threads/{thread_id}/mess
8383
## List messages
8484

8585
```http
86-
GET https://YOUR_RESOURCE_NAME.openai.azure.com/openai/threads/{thread_id}/messages?api-version=2024-02-15-preview
86+
GET https://YOUR_RESOURCE_NAME.openai.azure.com/openai/threads/{thread_id}/messages?api-version=2024-05-01-preview
8787
```
8888

8989
Returns a list of messages for a given thread.
@@ -117,7 +117,7 @@ from openai import AzureOpenAI
117117

118118
client = AzureOpenAI(
119119
api_key=os.getenv("AZURE_OPENAI_API_KEY"),
120-
api_version="2024-02-15-preview",
120+
api_version="2024-05-01-preview",
121121
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT")
122122
)
123123

@@ -129,7 +129,7 @@ print(thread_messages.data)
129129
# [REST](#tab/rest)
130130

131131
```console
132-
curl https://YOUR_RESOURCE_NAME.openai.azure.com/openai/threads/{thread_id}/messages?api-version=2024-02-15-preview \
132+
curl https://YOUR_RESOURCE_NAME.openai.azure.com/openai/threads/{thread_id}/messages?api-version=2024-05-01-preview \
133133
-H "api-key: $AZURE_OPENAI_API_KEY" \
134134
-H 'Content-Type: application/json'
135135
```
@@ -139,15 +139,15 @@ curl https://YOUR_RESOURCE_NAME.openai.azure.com/openai/threads/{thread_id}/mess
139139
## List message files
140140

141141
```http
142-
GET https://YOUR_RESOURCE_NAME.openai.azure.com/openai/threads/{thread_id}/messages/{message_id}/files?api-version=2024-02-15-preview
142+
GET https://YOUR_RESOURCE_NAME.openai.azure.com/openai/threads/{thread_id}/messages/{message_id}/files?api-version=2024-05-01-preview
143143
```
144144

145145
Returns a list of message files.
146146

147147
|Parameter| Type | Required | Description |
148148
|---|---|---|---|
149149
|`thread_id` | string | Required | The ID of the thread that the message and files belong to. |
150-
|`message_id`| string | Required | The ID of the message that the files belongs to. |
150+
|`message_id`| string | Required | The ID of the message that the files belong to. |
151151

152152
**Query Parameters**
153153

@@ -171,7 +171,7 @@ from openai import AzureOpenAI
171171

172172
client = AzureOpenAI(
173173
api_key=os.getenv("AZURE_OPENAI_API_KEY"),
174-
api_version="2024-02-15-preview",
174+
api_version="2024-05-01-preview",
175175
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT")
176176
)
177177

@@ -186,7 +186,7 @@ print(message_files)
186186
# [REST](#tab/rest)
187187

188188
```console
189-
curl https://YOUR_RESOURCE_NAME.openai.azure.com/openai/threads/{thread_id}/messages/files?api-version=2024-02-15-preview \
189+
curl https://YOUR_RESOURCE_NAME.openai.azure.com/openai/threads/{thread_id}/messages/files?api-version=2024-05-01-preview \
190190
-H "api-key: $AZURE_OPENAI_API_KEY" \
191191
-H 'Content-Type: application/json'
192192
```
@@ -196,7 +196,7 @@ curl https://YOUR_RESOURCE_NAME.openai.azure.com/openai/threads/{thread_id}/mess
196196
## Retrieve message
197197

198198
```http
199-
GET https://YOUR_RESOURCE_NAME.openai.azure.com/openai/threads/{thread_id}/messages/{message_id}?api-version=2024-02-15-preview
199+
GET https://YOUR_RESOURCE_NAME.openai.azure.com/openai/threads/{thread_id}/messages/{message_id}?api-version=2024-05-01-preview
200200
```
201201

202202
Retrieves a message file.
@@ -222,7 +222,7 @@ from openai import AzureOpenAI
222222

223223
client = AzureOpenAI(
224224
api_key=os.getenv("AZURE_OPENAI_API_KEY"),
225-
api_version="2024-02-15-preview",
225+
api_version="2024-05-01-preview",
226226
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT")
227227
)
228228

@@ -237,7 +237,7 @@ print(message)
237237
# [REST](#tab/rest)
238238

239239
```console
240-
curl https://YOUR_RESOURCE_NAME.openai.azure.com/openai/threads/{thread_id}/messages/{message_id}?api-version=2024-02-15-preview \
240+
curl https://YOUR_RESOURCE_NAME.openai.azure.com/openai/threads/{thread_id}/messages/{message_id}?api-version=2024-05-01-preview \
241241
-H "api-key: $AZURE_OPENAI_API_KEY" \
242242
-H 'Content-Type: application/json'
243243
```
@@ -247,7 +247,7 @@ curl https://YOUR_RESOURCE_NAME.openai.azure.com/openai/threads/{thread_id}/mess
247247
## Retrieve message file
248248

249249
```http
250-
GET https://YOUR_RESOURCE_NAME.openai.azure.com/openai/threads/{thread_id}/messages/{message_id}/files/{file_id}?api-version=2024-02-15-preview
250+
GET https://YOUR_RESOURCE_NAME.openai.azure.com/openai/threads/{thread_id}/messages/{message_id}/files/{file_id}?api-version=2024-05-01-preview
251251
```
252252

253253
Retrieves a message file.
@@ -273,7 +273,7 @@ from openai import AzureOpenAI
273273

274274
client = AzureOpenAI(
275275
api_key=os.getenv("AZURE_OPENAI_API_KEY"),
276-
api_version="2024-02-15-preview",
276+
api_version="2024-05-01-preview",
277277
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT")
278278
)
279279

@@ -288,7 +288,7 @@ print(message_files)
288288
# [REST](#tab/rest)
289289

290290
```console
291-
curl https://YOUR_RESOURCE_NAME.openai.azure.com/openai/threads/{thread_id}/messages/{message_id}/files/{file_id}?api-version=2024-02-15-preview
291+
curl https://YOUR_RESOURCE_NAME.openai.azure.com/openai/threads/{thread_id}/messages/{message_id}/files/{file_id}?api-version=2024-05-01-preview
292292
``` \
293293
-H "api-key: $AZURE_OPENAI_API_KEY" \
294294
-H 'Content-Type: application/json'
@@ -299,7 +299,7 @@ curl https://YOUR_RESOURCE_NAME.openai.azure.com/openai/threads/{thread_id}/mess
299299
## Modify message
300300

301301
```http
302-
POST https://YOUR_RESOURCE_NAME.openai.azure.com/openai/threads/{thread_id}/messages/{message_id}?api-version=2024-02-15-preview
302+
POST https://YOUR_RESOURCE_NAME.openai.azure.com/openai/threads/{thread_id}/messages/{message_id}?api-version=2024-05-01-preview
303303
```
304304

305305
Modifies a message.
@@ -328,7 +328,7 @@ from openai import AzureOpenAI
328328

329329
client = AzureOpenAI(
330330
api_key=os.getenv("AZURE_OPENAI_API_KEY"),
331-
api_version="2024-02-15-preview",
331+
api_version="2024-05-01-preview",
332332
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT")
333333
)
334334

@@ -346,7 +346,7 @@ print(message)
346346
# [REST](#tab/rest)
347347

348348
```console
349-
curl https://YOUR_RESOURCE_NAME.openai.azure.com/openai/threads/{thread_id}/messages/{message_id}?api-version=2024-02-15-preview
349+
curl https://YOUR_RESOURCE_NAME.openai.azure.com/openai/threads/{thread_id}/messages/{message_id}?api-version=2024-05-01-preview
350350
``` \
351351
-H "api-key: $AZURE_OPENAI_API_KEY" \
352352
-H 'Content-Type: application/json' \

0 commit comments

Comments
 (0)