Skip to content

Commit 243c76c

Browse files
committed
update
1 parent 7b1b948 commit 243c76c

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,11 @@ curl https://YOUR_RESOURCE_NAME.openai.azure.com/openai/assistants/{assistant_id
495495

496496
---
497497

498+
## File upload API reference
499+
500+
Assistants use the [same API for file upload as fine-tuning](/rest/api/azureopenai/files/upload?view=rest-azureopenai-2024-02-15-preview&tabs=HTTP). When uploading a file you have to specify an appropriate value for the [purpose parameter](/rest/api/azureopenai/files/upload?view=rest-azureopenai-2024-02-15-preview&tabs=HTTP#purpose).
501+
502+
498503
## Assistant object
499504

500505
| Field | Type | Description |

articles/ai-services/openai/how-to/assistant-functions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,5 +215,6 @@ After you submit tool outputs, the **Run** will enter the `queued` state before
215215

216216
## See also
217217

218+
* [Assistants API Reference](../assistants-reference.md)
218219
* Learn more about how to use Assistants with our [How-to guide on Assistants](../how-to/assistant.md).
219220
* [Azure OpenAI Assistants API samples](https://github.com/Azure-Samples/azureai-samples/tree/main/scenarios/Assistants)

articles/ai-services/openai/how-to/code-interpreter.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ We recommend using assistants with the latest models to take advantage of the ne
6464
|.xml|application/xml or "text/xml"|
6565
|.zip|application/zip|
6666

67+
### File upload API reference
68+
69+
Assistants use the [same API for file upload as fine-tuning](/rest/api/azureopenai/files/upload?view=rest-azureopenai-2024-02-15-preview&tabs=HTTP). When uploading a file you have to specify an appropriate value for the [purpose parameter](/rest/api/azureopenai/files/upload?view=rest-azureopenai-2024-02-15-preview&tabs=HTTP#purpose).
70+
6771
## Enable Code Interpreter
6872

6973
# [Python 1.x](#tab/python)
@@ -154,7 +158,7 @@ curl https://YOUR_RESOURCE_NAME.openai.azure.com/openai/assistants?api-version=2
154158
{ "type": "code_interpreter" }
155159
],
156160
"model": "gpt-4-1106-preview",
157-
"file_ids": ["file_123abc456"]
161+
"file_ids": ["assistant-123abc456"]
158162
}'
159163
```
160164

@@ -195,7 +199,7 @@ curl https://YOUR_RESOURCE_NAME.openai.azure.com/openai/threads/<YOUR-THREAD-ID>
195199
-d '{
196200
"role": "user",
197201
"content": "I need to solve the equation `3x + 11 = 14`. Can you help me?",
198-
"file_ids": ["file_123abc456"]
202+
"file_ids": ["asssistant-123abc456"]
199203
}'
200204
```
201205

@@ -212,7 +216,7 @@ Files generated by Code Interpreter can be found in the Assistant message respon
212216
"content": [
213217
{
214218
"image_file": {
215-
"file_id": "file-1YGVTvNzc2JXajI5JU9F0HMD"
219+
"file_id": "assistant-1YGVTvNzc2JXajI5JU9F0HMD"
216220
},
217221
"type": "image_file"
218222
},
@@ -233,7 +237,7 @@ client = AzureOpenAI(
233237
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT")
234238
)
235239

236-
image_data = client.files.content("file-abc123")
240+
image_data = client.files.content("assistant-abc123")
237241
image_data_bytes = image_data.read()
238242

239243
with open("./my-image.png", "wb") as file:
@@ -252,5 +256,7 @@ curl https://YOUR_RESOURCE_NAME.openai.azure.com/openai/files/<YOUR-FILE-ID>/con
252256

253257
## See also
254258

259+
* [File Upload API reference](/rest/api/azureopenai/files/upload?view=rest-azureopenai-2024-02-15-preview&tabs=HTTP)
260+
* [Assistants API Reference](../assistants-reference.md)
255261
* Learn more about how to use Assistants with our [How-to guide on Assistants](../how-to/assistant.md).
256262
* [Azure OpenAI Assistants API samples](https://github.com/Azure-Samples/azureai-samples/tree/main/scenarios/Assistants)

0 commit comments

Comments
 (0)