Skip to content

Commit 1873817

Browse files
committed
removing file operations
1 parent c0e4b8f commit 1873817

File tree

2 files changed

+2
-390
lines changed

2 files changed

+2
-390
lines changed

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

Lines changed: 1 addition & 171 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Learn how to use Azure OpenAI's Python & REST API messages with Ass
55
manager: nitinme
66
ms.service: azure-ai-openai
77
ms.topic: conceptual
8-
ms.date: 02/01/2024
8+
ms.date: 07/25/2024
99
author: mrbullwinkle
1010
ms.author: mbullwin
1111
recommendations: false
@@ -136,165 +136,6 @@ curl https://YOUR_RESOURCE_NAME.openai.azure.com/openai/threads/{thread_id}/mess
136136

137137
---
138138

139-
## List message files
140-
141-
```http
142-
GET https://YOUR_RESOURCE_NAME.openai.azure.com/openai/threads/{thread_id}/messages/{message_id}/files?api-version=2024-05-01-preview
143-
```
144-
145-
Returns a list of message files.
146-
147-
|Parameter| Type | Required | Description |
148-
|---|---|---|---|
149-
|`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 belong to. |
151-
152-
**Query Parameters**
153-
154-
|Name | Type | Required | Description |
155-
|--- |--- |--- |--- |
156-
| `limit` | integer | Optional - Defaults to 20 |A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.|
157-
| `order` | string | Optional - Defaults to desc |Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.|
158-
| `after` | string | Optional | A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.|
159-
| `before` | string | Optional | A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.|
160-
161-
### Returns
162-
163-
A list of [message file](#message-file-object) objects
164-
165-
### Example list message files request
166-
167-
# [Python 1.x](#tab/python)
168-
169-
```python
170-
from openai import AzureOpenAI
171-
172-
client = AzureOpenAI(
173-
api_key=os.getenv("AZURE_OPENAI_API_KEY"),
174-
api_version="2024-05-01-preview",
175-
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT")
176-
)
177-
178-
message_files = client.beta.threads.messages.files.list(
179-
thread_id="thread_abc123",
180-
message_id="msg_abc123"
181-
)
182-
print(message_files)
183-
184-
```
185-
186-
# [REST](#tab/rest)
187-
188-
```console
189-
curl https://YOUR_RESOURCE_NAME.openai.azure.com/openai/threads/{thread_id}/messages/files?api-version=2024-05-01-preview \
190-
-H "api-key: $AZURE_OPENAI_API_KEY" \
191-
-H 'Content-Type: application/json'
192-
```
193-
194-
---
195-
196-
## Retrieve message
197-
198-
```http
199-
GET https://YOUR_RESOURCE_NAME.openai.azure.com/openai/threads/{thread_id}/messages/{message_id}?api-version=2024-05-01-preview
200-
```
201-
202-
Retrieves a message file.
203-
204-
**Path parameters**
205-
206-
|Parameter| Type | Required | Description |
207-
|---|---|---|---|
208-
|`thread_id` | string | Required | The ID of the thread that the message belongs to. |
209-
|`message_id`| string | Required | The ID of the message to retrieve. |
210-
211-
212-
### Returns
213-
214-
The [message](#message-object) object matching the specified ID.
215-
216-
### Example retrieve message request
217-
218-
# [Python 1.x](#tab/python)
219-
220-
```python
221-
from openai import AzureOpenAI
222-
223-
client = AzureOpenAI(
224-
api_key=os.getenv("AZURE_OPENAI_API_KEY"),
225-
api_version="2024-05-01-preview",
226-
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT")
227-
)
228-
229-
message = client.beta.threads.messages.retrieve(
230-
message_id="msg_abc123",
231-
thread_id="thread_abc123",
232-
)
233-
print(message)
234-
235-
```
236-
237-
# [REST](#tab/rest)
238-
239-
```console
240-
curl https://YOUR_RESOURCE_NAME.openai.azure.com/openai/threads/{thread_id}/messages/{message_id}?api-version=2024-05-01-preview \
241-
-H "api-key: $AZURE_OPENAI_API_KEY" \
242-
-H 'Content-Type: application/json'
243-
```
244-
245-
---
246-
247-
## Retrieve message file
248-
249-
```http
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
251-
```
252-
253-
Retrieves a message file.
254-
255-
**Path parameters**
256-
257-
|Parameter| Type | Required | Description |
258-
|---|---|---|---|
259-
|`thread_id` | string | Required | The ID of the thread, which the message and file belongs to. |
260-
|`message_id`| string | Required | The ID of the message that the file belongs to. |
261-
|`file_id` | string | Required | The ID of the file being retrieved. |
262-
263-
**Returns**
264-
265-
The [message file](#message-file-object) object.
266-
267-
### Example retrieve message file request
268-
269-
# [Python 1.x](#tab/python)
270-
271-
```python
272-
from openai import AzureOpenAI
273-
274-
client = AzureOpenAI(
275-
api_key=os.getenv("AZURE_OPENAI_API_KEY"),
276-
api_version="2024-05-01-preview",
277-
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT")
278-
)
279-
280-
message_files = client.beta.threads.messages.files.retrieve(
281-
thread_id="thread_abc123",
282-
message_id="msg_abc123",
283-
file_id="assistant-abc123"
284-
)
285-
print(message_files)
286-
```
287-
288-
# [REST](#tab/rest)
289-
290-
```console
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
292-
``` \
293-
-H "api-key: $AZURE_OPENAI_API_KEY" \
294-
-H 'Content-Type: application/json'
295-
```
296-
297-
---
298139

299140
## Modify message
300141

@@ -377,14 +218,3 @@ Represents a message within a thread.
377218
| `run_id` | string or null |If applicable, the ID of the run associated with the authoring of this message.|
378219
| `file_ids` | array |A list of file IDs that the assistant should use. Useful for tools like retrieval and code_interpreter that can access files. A maximum of 10 files can be attached to a message.|
379220
| `metadata` | map |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.|
380-
381-
## Message file object
382-
383-
A list of files attached to a message.
384-
385-
|Name | Type | Description |
386-
|--- |--- |--- |
387-
| `id`| string | The identifier, which can be referenced in API endpoints.|
388-
|`object`|string| The object type, which is always `thread.message.file`.|
389-
|`created_at`|integer | The Unix timestamp (in seconds) for when the message file was created.|
390-
|`message_id`| string | The ID of the message that the File is attached to.|

0 commit comments

Comments
 (0)