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
In a console window (such as cmd, PowerShell, or Bash), use the `dotnet new` command to create a new console app with the name `azure-openai-quickstart`. This command creates a simple "Hello World" project with a single C# source file: *Program.cs*.
27
+
1. In a console window (such as cmd, PowerShell, or Bash), use the [`dotnet new`](/dotnet/core/tools/dotnet-new) command to create a new console app with the name `azure-openai-quickstart`:
28
+
29
+
```dotnetcli
30
+
dotnet new console -n azure-openai-assistants-quickstart
31
+
```
28
32
29
-
```dotnetcli
30
-
dotnet new console -n azure-openai-assistants-quickstart
31
-
```
32
-
33
-
Change your directory to the newly created app folder. You can build the application with:
33
+
2. Change into the directory of the newly created app folder and build the app with the [`dotnet build`](/dotnet/core/tools/dotnet-build) command:
34
34
35
-
```dotnetcli
36
-
dotnet build
37
-
```
35
+
```dotnetcli
36
+
dotnet build
37
+
```
38
38
39
-
The build output should contain no warnings or errors.
39
+
The build output should contain no warnings or errors.
40
+
41
+
```output
42
+
...
43
+
Build succeeded.
44
+
0 Warning(s)
45
+
0 Error(s)
46
+
...
47
+
```
40
48
41
-
```output
42
-
...
43
-
Build succeeded.
44
-
0 Warning(s)
45
-
0 Error(s)
46
-
...
47
-
```
49
+
3. Install the [OpenAI .NET client library](https://www.nuget.org/packages/Azure.AI.OpenAI/) with the [dotnet add package](/dotnet/core/tools/dotnet-add-package) command:
Passwordless authentication is more secure than key-based alternatives and is the recommended approach for connecting to Azure services. If you choose Passwordless authentication, you'll need to complete the following:
60
62
61
-
In our code we are going to specify the following values:
63
+
1. Add the [`Azure.Identity`](https://www.nuget.org/packages/Azure.Identity) package.
62
64
63
-
|**Name**|**Description**|
64
-
|:---|:---|
65
-
|**Assistant name**| Your deployment name that is associated with a specific model. |
66
-
|**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. |
67
-
|**Model**| This is where you set which model deployment name to use with your assistant. The retrieval tool requires `gpt-35-turbo (1106)` or `gpt-4 (1106-preview)` model. **Set this value to your deployment name, not the model name unless it is the same.**|
68
-
|**Code interpreter**| Code interpreter provides access to a sandboxed Python environment that can be used to allow the model to test and execute code. |
65
+
```dotnetcli
66
+
dotnet add package Azure.Identity
67
+
```
69
68
70
-
### Tools
69
+
1. Assign the `Cognitive Services User` role to your user account. This can be done in the Azure portal on your OpenAI resource under **Access control (IAM)** > **Add role assignment**.
70
+
1. Sign-in to Azure using Visual Studio or the Azure CLI via `az login`.
71
71
72
-
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).
72
+
### Create the assistant
73
73
74
-
Create and run an assistant with the following:
74
+
Update the `Program.cs` file with the following code to create an assistant:
The graph above visualizes the sales trend for product 113045 from January to March. As seen, the sales peaked in February with 22 units sold, and fluctuated over the period from January (12 units) to March (16 units).
234
+
235
+
If you need further analysis or more details, feel free to ask!
0 commit comments