Skip to content

Commit a69e088

Browse files
authored
Merge pull request #273028 from MicrosoftDocs/main
4/23 11:00 AM IST Publish
2 parents 9201be3 + 0ca0367 commit a69e088

File tree

46 files changed

+479
-504
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+479
-504
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ ms.custom: devx-track-python
1414

1515
# Assistants API (Preview) messages reference
1616

17+
[!INCLUDE [Assistants v2 note](includes/assistants-v2-note.md)]
18+
1719
This article provides reference documentation for Python and REST for the new Assistants API (Preview). More in-depth step-by-step guidance is provided in the [getting started guide](./how-to/assistant.md).
1820

1921
## Create message

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ ms.custom: devx-track-python
1414

1515
# Assistants API (Preview) runs reference
1616

17+
[!INCLUDE [Assistants v2 note](includes/assistants-v2-note.md)]
18+
1719
This article provides reference documentation for Python and REST for the new Assistants API (Preview). More in-depth step-by-step guidance is provided in the [getting started guide](./how-to/assistant.md).
1820

1921
## Create run

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ ms.custom: devx-track-python
1414

1515
# Assistants API (Preview) threads reference
1616

17+
[!INCLUDE [Assistants v2 note](includes/assistants-v2-note.md)]
18+
1719
This article provides reference documentation for Python and REST for the new Assistants API (Preview). More in-depth step-by-step guidance is provided in the [getting started guide](./how-to/assistant.md).
1820

1921
## Create a thread

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ ms.custom: devx-track-python
1414

1515
# Assistants API (Preview) reference
1616

17+
18+
[!INCLUDE [Assistants v2 note](includes/assistants-v2-note.md)]
19+
1720
This article provides reference documentation for Python and REST for the new Assistants API (Preview). More in-depth step-by-step guidance is provided in the [getting started guide](./how-to/assistant.md).
1821

1922
## Create an assistant
@@ -497,7 +500,7 @@ curl https://YOUR_RESOURCE_NAME.openai.azure.com/openai/assistants/{assistant_id
497500

498501
## File upload API reference
499502

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).
503+
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&preserve-view=true). 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&preserve-view=true).
501504

502505

503506
## Assistant object

articles/ai-services/openai/concepts/use-your-data.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,10 @@ If you want to implement additional value-based criteria for query execution, yo
150150
* The search type is limited to [Integrated Vector Database in Azure Cosmos DB for MongoDB](/azure/cosmos-db/mongodb/vcore/vector-search) with an Azure OpenAI embedding model.
151151
* This implementation works best on unstructured and spatial data.
152152

153+
153154
### Data preparation
154155

155-
Use the script provided on [GitHub](https://github.com/microsoft/sample-app-aoai-chatGPT/blob/feature/2023-9/scripts/cosmos_mongo_vcore_data_preparation.py) to prepare your data.
156+
Use the script provided on [GitHub](https://github.com/microsoft/sample-app-aoai-chatGPT/tree/main/scripts#data-preparation) to prepare your data.
156157

157158
<!--### Add your data source in Azure OpenAI Studio
158159

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ recommendations: false
1717

1818
The Assistants API supports function calling, which allows you to describe the structure of functions to an Assistant and then return the functions that need to be called along with their arguments.
1919

20+
[!INCLUDE [Assistants v2 note](../includes/assistants-v2-note.md)]
21+
2022
## Function calling support
2123

2224
### Supported models

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: 'How to create Assistants with Azure OpenAI Service'
33
titleSuffix: Azure OpenAI
4-
description: Learn how to create helpful AI Assistants with tools like Code Interpreter
4+
description: Learn how to create helpful AI Assistants with tools like Code Interpreter.
55
services: cognitive-services
66
manager: nitinme
77
ms.service: azure-ai-openai
@@ -16,7 +16,9 @@ recommendations: false
1616

1717
# Getting started with Azure OpenAI Assistants (Preview)
1818

19-
Azure OpenAI Assistants (Preview) allows you to create AI assistants tailored to your needs through custom instructions and augmented by advanced tools like code interpreter, and custom functions. In this article we'll provide an in-depth walkthrough of getting started with the Assistants API.
19+
Azure OpenAI Assistants (Preview) allows you to create AI assistants tailored to your needs through custom instructions and augmented by advanced tools like code interpreter, and custom functions. In this article, we provide an in-depth walkthrough of getting started with the Assistants API.
20+
21+
[!INCLUDE [Assistants v2 note](../includes/assistants-v2-note.md)]
2022

2123
## Assistants support
2224

@@ -149,7 +151,7 @@ print(assistant.model_dump_json(indent=2))
149151

150152
### Create a thread
151153

152-
Now let's create a thread
154+
Now let's create a thread.
153155

154156
```python
155157
# Create a thread
@@ -161,9 +163,9 @@ print(thread)
161163
Thread(id='thread_6bunpoBRZwNhovwzYo7fhNVd', created_at=1705972465, metadata={}, object='thread')
162164
```
163165

164-
A thread is essentially the record of the conversation session between the assistant and the user. It's similar to the messages array/list in a typical chat completions API call. One of the key differences, is unlike a chat completions messages array, you don't need to track tokens with each call to make sure that you're remaining below the context length of the model. Threads abstract away this management detail and will compress the thread history as needed in order to allow the conversation to continue. The ability for threads to accomplish this with larger conversations is enhanced when using the latest models, which have larger context lengths as well as support for the latest features.
166+
A thread is essentially the record of the conversation session between the assistant and the user. It's similar to the messages array/list in a typical chat completions API call. One of the key differences, is unlike a chat completions messages array, you don't need to track tokens with each call to make sure that you're remaining below the context length of the model. Threads abstract away this management detail and will compress the thread history as needed in order to allow the conversation to continue. The ability for threads to accomplish this with larger conversations is enhanced when using the latest models, which have larger context lengths and support for the latest features.
165167

166-
Next create the first user question to add to the thread
168+
Next create the first user question to add to the thread.
167169

168170
```python
169171
# Add a user question to the thread
@@ -388,7 +390,7 @@ image = Image.open("sinewave.png")
388390
image.show()
389391
```
390392

391-
:::image type="content" source="../media/how-to/assistants/sine-wave.png" alt-text="Screenshot of code interpreter generated sinewave." lightbox="../media/how-to/assistants/sine-wave.png":::
393+
:::image type="content" source="../media/how-to/assistants/sine-wave.png" alt-text="Screenshot of code interpreter generated sine wave." lightbox="../media/how-to/assistants/sine-wave.png":::
392394

393395
### Ask a follow-up question on the thread
394396

@@ -840,7 +842,7 @@ image = Image.open("dark_sine.png")
840842
image.show()
841843
```
842844

843-
:::image type="content" source="../media/how-to/assistants/dark-mode.png" alt-text="Screenshot of code interpreter generated sinewave in darkmode." lightbox="../media/how-to/assistants/dark-mode.png":::
845+
:::image type="content" source="../media/how-to/assistants/dark-mode.png" alt-text="Screenshot of code interpreter generated sine wave in dark mode." lightbox="../media/how-to/assistants/dark-mode.png":::
844846

845847
## Additional reference
846848

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ Code Interpreter allows the Assistants API to write and run Python code in a san
2020
> [!IMPORTANT]
2121
> Code Interpreter has [additional charges](https://azure.microsoft.com/pricing/details/cognitive-services/openai-service/) beyond the token based fees for Azure OpenAI usage. If your Assistant calls Code Interpreter simultaneously in two different threads, two code interpreter sessions are created. Each session is active by default for one hour.
2222
23+
[!INCLUDE [Assistants v2 note](../includes/assistants-v2-note.md)]
24+
2325
## Code interpreter support
2426

2527
### Supported models
@@ -66,7 +68,7 @@ We recommend using assistants with the latest models to take advantage of the ne
6668

6769
### File upload API reference
6870

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).
71+
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&preserve-view=true). 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&preserve-view=true#purpose).
7072

7173
## Enable Code Interpreter
7274

@@ -256,7 +258,7 @@ curl https://YOUR_RESOURCE_NAME.openai.azure.com/openai/files/<YOUR-FILE-ID>/con
256258

257259
## See also
258260

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

articles/ai-services/openai/includes/assistants-python.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ Install the OpenAI Python client library with:
3333
pip install openai==v1.20.0
3434
```
3535

36-
> [!NOTE]
37-
> Azure OpenAI does not yet support Assistants V2. Please use the v1.20.0 release of the OpenAI Python library until V2 support is available.
36+
[!INCLUDE [Assistants v2 note](./assistants-v2-note.md)]
3837

3938
> [!NOTE]
4039
> This library is maintained by OpenAI. Refer to the [release history](https://github.com/openai/openai-python/releases) to track the latest updates to the library.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
manager: nitinme
3+
author: aahill
4+
ms.author: aahi
5+
ms.service: azure-ai-openai
6+
ms.topic: include
7+
ms.date: 04/22/2024
8+
---
9+
10+
> [!NOTE]
11+
> Azure OpenAI does not yet support Assistants V2. Please use the v1.20.0 release of the OpenAI Python library until V2 support is available.

0 commit comments

Comments
 (0)