You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/ai-services/openai/includes/chatgpt-studio.md
+15-60Lines changed: 15 additions & 60 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,19 +6,13 @@ description: Walkthrough on how to get started with Azure OpenAI and make your f
6
6
manager: nitinme
7
7
ms.service: azure-ai-openai
8
8
ms.topic: include
9
-
ms.date: 03/01/2023
9
+
ms.date: 09/19/2024
10
10
---
11
11
12
12
## Prerequisites
13
13
14
14
- An Azure subscription - [Create one for free](https://azure.microsoft.com/free/cognitive-services?azure-portal=true).
15
-
- An Azure OpenAI Service resource with either the `gpt-35-turbo` or the `gpt-4` models deployed. For more information about model deployment, see the [resource deployment guide](../how-to/create-resource.md).
16
-
17
-
> [!div class="nextstepaction"]
18
-
> [I ran into an issue with the prerequisites.](https://microsoft.qualtrics.com/jfe/form/SV_0Cl5zkG3CnDjq6O?PLanguage=STUDIO&Pillar=AOAI&Product=Chatgpt&Page=quickstart&Section=Prerequisites)
19
-
20
-
> [!TIP]
21
-
> Try out the new unified [Azure AI Studio (preview)](../../../ai-studio/what-is-ai-studio.md) which brings together capabilities from across multiple Azure AI services.
15
+
- An Azure OpenAI Service resource with either `gpt-4o` or the `gpt-4o-mini` models deployed. We recommend using standard or global standard model [deployment tpyes](../how-to/deployment-types.md) for initial exploration. For more information about model deployment, see the [resource deployment guide](../how-to/create-resource.md).
22
16
23
17
## Go to Azure OpenAI Studio
24
18
@@ -34,82 +28,43 @@ Start exploring OpenAI capabilities with a no-code approach through the Azure Op
34
28
35
29
:::image type="content" source="../media/quickstarts/chatgpt-playground-load.png" alt-text="Screenshot of the Chat playground page." lightbox="../media/quickstarts/chatgpt-playground-load.png":::
36
30
37
-
### Assistant setup
31
+
### Setup
38
32
39
-
You can use the **Assistant setup** dropdown to select a few pre-loaded **System message** examples to get started.
33
+
You can use the **Prompt samples* dropdown to select a few pre-loaded **System message** examples to get started.
40
34
41
35
**System messages** give the model instructions 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.
42
36
43
-
**Add few-shot examples** allows you to provide conversational examples that are used by the model for [in-context learning](../concepts/prompt-engineering.md#basics).
44
-
45
37
At any time while using the Chat playground you can select **View code** to see Python, curl, and json code samples pre-populated based on your current chat session and settings selections. You can then take this code and write an application to complete the same task you're currently performing with the playground.
46
38
47
39
### Chat session
48
40
49
-
Selecting the **Send** button sends the entered text to the completions API and the results are returned back to the text box.
41
+
Selecting the **Enter** button or selecting the right arrow icon sends the entered text to the chat completions API and the results are returned back to the text box.
50
42
51
43
Select the **Clear chat** button to delete the current conversation history.
| Deployments | Your deployment name that is associated with a specific model. |
50
+
| Add your data |
51
+
| Parameters | Custom parameters that alter the model responses. When you are starting out we recommend to use the defaults for most parameters |
58
52
| Temperature | Controls randomness. Lowering the temperature means that the model produces more repetitive and deterministic responses. Increasing the temperature results in more unexpected or creative responses. Try adjusting temperature or Top P but not both. |
59
-
| Max length (tokens) | Set a limit on the number of tokens per model response. The API supports a maximum of 4096 tokens shared between the prompt (including system message, examples, message history, and user query) and the model's response. One token is roughly four characters for typical English text.|
60
-
| Top probabilities | Similar to temperature, this controls randomness but uses a different method. Lowering Top P narrows the model’s token selection to likelier tokens. Increasing Top P lets the model choose from tokens with both high and low likelihood. Try adjusting temperature or Top P but not both.|
61
-
| Multi-turn conversations | Select the number of past messages to include in each new API request. This helps give the model context for new user queries. Setting this number to 10 results in five user queries and five system responses.|
53
+
| Max response (tokens) | Set a limit on the number of tokens per model response. The API on the latest models supports a maximum of 128,000 tokens shared between the prompt (including system message, examples, message history, and user query) and the model's response. One token is roughly four characters for typical English text.|
54
+
| Top p | Similar to temperature, this controls randomness but uses a different method. Lowering Top P narrows the model’s token selection to likelier tokens. Increasing Top P lets the model choose from tokens with both high and low likelihood. Try adjusting temperature or Top P but not both.|
62
55
| Stop sequences | Stop sequence make the model end its response at a desired point. The model response ends before the specified sequence, so it won't contain the stop sequence text. For GPT-35-Turbo, using `<|im_end|>` ensures that the model response doesn't generate a follow-up user query. You can include as many as four stop sequences.|
63
56
64
-
### Show panels
65
-
66
-
By default there are three panels: assistant setup, chat session, and settings. **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.
67
-
68
-
## Start a chat session
69
-
70
-
1. From the assistant setup drop-down, select **Xbox customer support agent**
71
-
2. You'll be prompted asking if you want to update the system message, select **Continue**.
72
-
3. In the chat session pane, enter the following question: "I'm interested in buying a new Xbox", and select **Send**.
73
-
4. You'll receive a response similar to:
57
+
## View code
74
58
75
-
:::image type="content" source="../media/quickstarts/xbox.png" alt-text="Screenshot of a first question and answer in playground." lightbox="../media/quickstarts/xbox.png":::
59
+
Once you have experimented with chatting with the model select the **</> View Code** button. This will give you a replay of the code behind your entire conversation so far:
76
60
77
-
5. Enter a follow-up question like: "which models support 4K?"
78
-
79
-
:::image type="content" source="../media/quickstarts/models.png" alt-text="Screenshot of follow-up question and answer in playground." lightbox="../media/quickstarts/models.png":::
80
-
81
-
6. Now that you have a basic conversation select **View code** from under **Assistant setup** and you'll have a replay of the code behind the entire conversation so far:
82
-
83
-
```python
84
-
#Note: The openai-python library support for Azure OpenAI is in preview.
engine="gpt-35-turbo", # replace this value with the deployment name you chose when you deployed the associated model.
94
-
messages = [{"role":"system","content":"You are an Xbox customer support agent whose primary goal is to help users with issues they are experiencing with their Xbox devices. You are friendly and concise. You only provide factual answers to queries, and do not provide answers that are not related to Xbox."},{"role":"user","content":"How much is a PS5?"},{"role":"assistant","content":"I apologize, but I do not have information about the prices of other gaming devices such as the PS5. My primary focus is to assist with issues regarding Xbox devices. Is there a specific issue you are having with your Xbox device that I may be able to help with?"},{"role":"user","content":"I am interested in buying an Xbox?"},{"role":"assistant","content":"Great! There are several Xbox models available in the market, including the Xbox Series X, Xbox Series S, and Xbox One. The Xbox Series X is the latest and most powerful console, while the Xbox Series S is a more affordable option that still offers great performance. The Xbox One is the previous generation console, but it still has a large library of games available to play.\n\nBefore purchasing an Xbox, you may want to consider factors such as your budget, the types of games you want to play, and whether you want to play games in 4K resolution. Once you have decided on a console, you can purchase it from a retailer or directly from the Xbox website. Let me know if you have any other questions or concerns!"},{"role":"user","content":"Which models are 4K?"},{"role":"assistant","content":"Both the Xbox Series X and Xbox One X support 4K resolution gaming. The Xbox Series S, on the other hand, supports up to 1440p resolution gaming, but it can upscale games to 4K. It's worth noting that in order to take advantage of 4K gaming, you'll need a 4K TV or monitor that supports HDR (High Dynamic Range) and HDMI 2.0 or higher."}],
95
-
temperature=0,
96
-
max_tokens=350,
97
-
top_p=0.95,
98
-
frequency_penalty=0,
99
-
presence_penalty=0,
100
-
stop=None)
101
-
```
102
-
103
-
> [!div class="nextstepaction"]
104
-
> [I ran into an issue with the playground.](https://microsoft.qualtrics.com/jfe/form/SV_0Cl5zkG3CnDjq6O?PLanguage=STUDIO&Pillar=AOAI&Product=Chatgpt&Page=quickstart&Section=Set-up)
61
+
:::image type="content" source="../media/quickstarts/chat-view-code.png" alt-text="Screenshot of view code experience." lightbox="../media/quickstarts/chat-view-code.png":::
105
62
106
63
### Understanding the prompt structure
107
64
108
-
If you examine the sample from **View code** you'll notice some unique tokens that weren't part of a typical GPT completion call. GPT-35-Turbo was trained to use special tokens to delineate different parts of the prompt. Content is provided to the model in between `<|im_start|>` and `<|im_end|>` tokens. The prompt begins with a system message that can be used to prime the model by including context or instructions for the model. After that, the prompt contains a series of messages between the user and the assistant.
109
-
110
-
The assistant's response to the prompt will then be returned below the `<|im_start|>assistant` token and will end with `<|im_end|>` denoting that the assistant has finished its response. You can also use the **Show raw syntax** toggle button to display these tokens within the chat session panel.
65
+
If you examine the sample from **View code** you'll notice that the conversation is broken into three distinct roles `system`, `user`, `assistant`. Each time you message the model the entire conversation history up to that point is resent. When using the chat completions API the model has no true memory of what you have sent to it in the past so you provide the conversation history for context to allow the model to respond properly.
111
66
112
-
The [GPT-35-Turbo & GPT-4 how-to guide](../how-to/chatgpt.md) provides an in-depth introduction into the new prompt structure and how to use the `gpt-35-turbo` model effectively.
67
+
The [Chat completions how-to guide](../how-to/chatgpt.md) provides an in-depth introduction into the new prompt structure and how to use chat completions models effectively.
0 commit comments