Skip to content

Commit 2b88dab

Browse files
authored
Merge pull request #268948 from aahill/mrb-pr-update
Assistants for AI Studio
2 parents 97eaaeb + 9f4e1bd commit 2b88dab

File tree

7 files changed

+165
-4
lines changed

7 files changed

+165
-4
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.custom: devx-track-python
88
ms.topic: quickstart
99
author: mrbullwinkle
1010
ms.author: mbullwin
11-
ms.date: 02/01/2024
11+
ms.date: 03/13/2024
1212
zone_pivot_groups: openai-quickstart-assistants
1313
recommendations: false
1414
---
@@ -20,7 +20,13 @@ Azure OpenAI Assistants (Preview) allows you to create AI assistants tailored to
2020

2121
::: zone pivot="programming-language-studio"
2222

23-
[!INCLUDE [Studio quickstart](includes/assistants-studio.md)]
23+
[!INCLUDE [Azure OpenAI Studio quickstart](includes/assistants-studio.md)]
24+
25+
::: zone-end
26+
27+
::: zone pivot="programming-language-ai-studio"
28+
29+
[!INCLUDE [AI Studio (Preview)](includes/assistants-ai-studio.md)]
2430

2531
::: zone-end
2632

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
---
2+
title: Quickstart - getting started with Azure OpenAI assistants (preview) in AI Studio
3+
titleSuffix: Azure OpenAI
4+
description: Walkthrough on how to get started with Azure OpenAI assistants with new features like code interpreter in AI Studio (Preview).
5+
manager: nitinme
6+
ms.service: azure-ai-studio
7+
ms.custom:
8+
ms.topic: include
9+
ms.date: 03/04/2024
10+
ms.author: mbullwin
11+
author: mrbullwinkle
12+
---
13+
14+
[!INCLUDE [Azure AI Studio preview](../../../ai-studio/includes/preview-ai-studio.md)]
15+
16+
## Prerequisites
17+
18+
- An Azure subscription - <a href="https://azure.microsoft.com/free/cognitive-services" target="_blank">Create one for free</a>.
19+
- Access granted to Azure OpenAI in the desired Azure subscription.
20+
21+
Currently, access to this service is granted only by application. You can apply for access to Azure OpenAI by completing the form at <a href="https://aka.ms/oai/access" target="_blank">https://aka.ms/oai/access</a>. Open an issue on this repo to contact us if you have an issue.
22+
- An [Azure AI hub resource](../../../ai-studio/how-to/create-azure-ai-resource.md) with a model deployed. For more information about model deployment, see the [resource deployment guide](../how-to/create-resource.md).
23+
- An [Azure AI project](../../../ai-studio/how-to/create-projects.md) in Azure AI Studio.
24+
25+
## Go to the Azure AI Studio (Preview)
26+
27+
1. Sign in to [Azure AI Studio](https://ai.azure.com).
28+
1. Go to your project or [create a new project](../../../ai-studio//how-to/create-projects.md) in Azure AI Studio.
29+
1. From the Azure AI Studio Home page, select **Build** > **Playground**.
30+
31+
The Assistants playground allows you to explore, prototype, and test AI Assistants without needing to run any code. From this page, you can quickly iterate and experiment with new ideas.
32+
33+
The playground provides several options to configure your Assistant. In the following steps, you will use the **Assistant setup** pane to create a new AI assistant.
34+
35+
| **Name** | **Description** |
36+
|:---|:---|
37+
| **Assistant name** | Your deployment name that is associated with a specific model. |
38+
| **Instructions** | Instructions are similar to system messages this is where you give the model guidance about how it should behave and any context it should reference when generating a response. You can describe the assistant's personality, tell it what it should and shouldn't answer, and tell it how to format responses. You can also provide examples of the steps it should take when answering responses. |
39+
| **Deployment** | This is where you set which model deployment to use with your assistant. |
40+
| **Functions**| Create custom function definitions for the models to formulate API calls and structure data outputs based on your specifications. Not used in this quickstart. |
41+
| **Code interpreter** | Code interpreter provides access to a sandboxed Python environment that can be used to allow the model to test and execute code. |
42+
| **Files** | You can upload up to 20 files, with a max file size of 512 MB to use with tools. Not used in this quickstart. |
43+
44+
45+
1. Select your deployment from the **Deployments** dropdown.
46+
1. Select **Assistants** from the **Mode** dropdown menu.
47+
48+
:::image type="content" source="../media/quickstarts/assistants-ai-studio-playground.png" alt-text="Screenshot of the Assistant configuration screen without all the values filled in." lightbox="../media/quickstarts/assistants-ai-studio-playground.png":::
49+
50+
## Create your first Assistant
51+
52+
1. From the Assistant setup drop-down, select **New**.
53+
2. Give your Assistant a name.
54+
3. Enter the following instructions "You are an AI assistant that can write code to help answer math questions"
55+
4. Select a model deployment. We recommend testing with one of the latest gpt-4 models.
56+
5. Select the toggle enabling code interpreter.
57+
6. Select Save.
58+
59+
:::image type="content" source="../media/quickstarts/assistant-configuration.png" alt-text="Screenshot of the assistant with configuration details entered." lightbox="../media/quickstarts/assistant-configuration.png":::
60+
61+
7. Enter a question for the assistant to answer: "I need to solve the equation `3x + 11 = 14`. Can you help me?"
62+
8. Select the **Add and run button** :::image type="icon" source="../media/quickstarts/run.png":::
63+
64+
```output
65+
The solution to the equation (3x + 11 = 14) is (x = 1).
66+
```
67+
68+
While we can see that answer is correct, to confirm that the model used code interpreter to get to this answer, and that the code it wrote is valid rather than just repeating an answer from the model's training data we'll ask another question.
69+
70+
9. Enter the follow-up question: "Show me the code you ran to get this solution."
71+
72+
```output
73+
Sure. The code is very straightforward
74+
```
75+
76+
```python
77+
# calculation
78+
x = (14 - 11) / 3
79+
x
80+
81+
```
82+
83+
```output
84+
First, we subtract 11 from 14, then divide the result by 3. This gives us the value of x which is 1.0.
85+
````
86+
87+
:::image type="content" source="../media/quickstarts/assistant-ai-studio-session.png" alt-text="Screenshot of conversation session in the Assistant playground." lightbox="../media/quickstarts/assistant-ai-studio-session.png":::
88+
89+
You could also consult the logs in the right-hand panel to confirm that code interpreter was used and to validate the code that was run to generate the response. It is important to remember that while code interpreter gives the model the capability to respond to more complex math questions by converting the questions into code and running in a sandboxed Python environment, you still need to validate the response to confirm that the model correctly translated your question into a valid representation in code.
90+
91+
## Key concepts
92+
93+
While using the Assistants playground, keep the following concepts in mind.
94+
95+
### Tools
96+
97+
An individual assistant can access up to 128 tools including `code interpreter`, as well as any custom tools you create via [functions](../how-to/assistant-functions.md).
98+
99+
### Chat session
100+
101+
Chat session also known as a *thread* within the Assistant's API is where the conversation between the user and assistant occurs. Unlike traditional chat completion calls there is no limit to the number of messages in a thread. The assistant will automatically compress requests to fit the input token limit of the model.
102+
103+
This also means that you are not controlling how many tokens are passed to the model during each turn of the conversation. Managing tokens is abstracted away and handled entirely by the Assistants API.
104+
105+
Select the **Clear chat** button to delete the current conversation history.
106+
107+
Underneath the text input box there are two buttons:
108+
109+
- Add a message without run.
110+
- Add and run.
111+
112+
### Logs
113+
114+
Logs provide a detailed snapshot of what the assistant API activity.
115+
116+
### Show panels
117+
118+
By default there are three panels: assistant setup, chat session, and Logs. **Show panels** allows you to add, remove, and rearrange the panels. If you ever close a panel and need to get it back, use **Show panels** to restore the lost panel.
119+
120+
## Clean up resources
121+
122+
If you want to clean up and remove an OpenAI resource, you can delete the resource or resource group. Deleting the resource group also deletes any other resources associated with it.
123+
124+
- [Portal](../../multi-service-resource.md?pivots=azportal#clean-up-resources)
125+
- [Azure CLI](../../multi-service-resource.md?pivots=azcli#clean-up-resources)
126+
127+
Alternatively you can delete the [assistant](../assistants-reference.md#delete-assistant), or [thread](../assistants-reference-threads.md#delete-thread) via the [Assistant's API](../assistants-reference.md).
128+
129+
## See also
130+
131+
* Learn more about how to use Assistants with our [How-to guide on Assistants](../how-to/assistant.md).
132+
* [Azure OpenAI Assistants API samples](https://github.com/Azure-Samples/azureai-samples/tree/main/scenarios/Assistants)
147 KB
Loading
161 KB
Loading
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
title: Quickstart - Getting started with Azure OpenAI Assistants (Preview) in AI Studio
3+
titleSuffix: Azure OpenAI
4+
description: Walkthrough on how to get started with Azure OpenAI assistants with new features like code interpreter in AI Studio (Preview).
5+
manager: nitinme
6+
ms.service: azure-ai-studio
7+
ms.custom:
8+
ms.topic: quickstart
9+
ms.date: 03/04/2024
10+
ms.author: mbullwin
11+
author: mrbullwinkle
12+
---
13+
14+
15+
# Quickstart: Get started using Azure OpenAI Assistants (Preview) in Azure AI Studio playground
16+
17+
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.
18+
19+
[!INCLUDE [AI Studio (Preview)](../../ai-services/openai/includes/assistants-ai-studio.md)]

articles/ai-studio/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
href: quickstarts/multimodal-vision.md
2727
- name: Generate text completions in the playground
2828
href: quickstarts/playground-completions.md
29+
- name: Get started with Assistants and code interpreter in the playground
30+
href: quickstarts/assistants.md
2931
- name: Tutorials
3032
items:
3133
- name: Deploy a chat web app

articles/zone-pivot-groups.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1899,10 +1899,12 @@ groups:
18991899
pivots:
19001900
- id: programming-language-studio
19011901
title: Azure OpenAI Studio
1902-
- id: programming-language-python
1903-
title: Python
1902+
- id: programming-language-ai-studio
1903+
title: AI Studio (Preview)
19041904
- id: programming-language-csharp
19051905
title: C#
1906+
- id: programming-language-python
1907+
title: Python
19061908
- id: rest-api
19071909
title: REST
19081910
# Owner: mbullwin

0 commit comments

Comments
 (0)