Skip to content

Commit 00bdd89

Browse files
committed
updates
1 parent 617f23a commit 00bdd89

File tree

1 file changed

+26
-5
lines changed

1 file changed

+26
-5
lines changed

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

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ ms.date: 9/27/2024
2424

2525
### Create a new .NET Core application
2626

27-
1. 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`:
2828

2929
```dotnetcli
3030
dotnet new console -n azure-openai-assistants-quickstart
3131
```
3232
33-
2. 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:
3434
3535
```dotnetcli
3636
dotnet build
@@ -46,10 +46,10 @@ ms.date: 9/27/2024
4646
...
4747
```
4848
49-
3. Install the OpenAI .NET client library with:
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:
5050
5151
```console
52-
dotnet add package Azure.AI.OpenAI.Assistants --prerelease
52+
dotnet add package Azure.AI.OpenAI --prerelease
5353
```
5454
5555
[!INCLUDE [get-key-endpoint](get-key-endpoint.md)]
@@ -58,7 +58,7 @@ ms.date: 9/27/2024
5858
5959
### Create the assistant
6060
61-
Create and run an assistant with the following:
61+
Update the `Program.cs` file with the following code to create an assistant:
6262
6363
```csharp
6464
using Azure;
@@ -198,6 +198,27 @@ await foreach (ThreadMessage message in messages)
198198
}
199199
```
200200

201+
Run the app using the [`dotnet run`](/dotnet/core/tools/dotnet-run) command:
202+
203+
```csharp
204+
dotnet run
205+
```
206+
207+
The console output should resemble the following:
208+
209+
```text
210+
[USER]: How well did product 113045 sell in February? Graph its trend over time.
211+
212+
[ASSISTANT]: Product 113045 sold 22 units in February. Let's visualize its sales trend over the given months (January through March).
213+
214+
I'll create a graph to depict this trend.
215+
216+
[ASSISTANT]: <image: 553380b7-fdb6-49cf-9df6-e8e6700d69f4.png>
217+
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).
218+
219+
If you need further analysis or more details, feel free to ask!
220+
```
221+
201222
## Clean up resources
202223

203224
If you want to clean up and remove an Azure OpenAI resource, you can delete the resource or resource group. Deleting the resource group also deletes any other resources associated with it.

0 commit comments

Comments
 (0)