@@ -98,16 +98,12 @@ class AssistantService {
9898Lastly, create an instance of the service and call the ` Chat ` method when the app users browses the app:
9999``` csharp
100100var service = new AssistantService ();
101- app .MapGet (" /" , async () => {
102- return await service .Chat (" List all noble gases" );
103- });
101+ app .MapGet (" /" , async () => await service .Chat (" List all noble gases" ));
104102```
105103The full program should look like following:
106104``` csharp
107105using Azure .CloudMachine ;
108106using Azure .CloudMachine .OpenAI ;
109- using Azure .Provisioning .CloudMachine ;
110- using Azure .Provisioning .CloudMachine .OpenAI ;
111107using OpenAI .Chat ;
112108
113109if (CloudMachineInfrastructure .Configure (args , AssistantService .Configure )) return ;
@@ -116,9 +112,7 @@ var builder = WebApplication.CreateBuilder(args);
116112var app = builder .Build ();
117113
118114var service = new AssistantService ();
119- app .MapGet (" /" , async () => {
120- return await service .Chat (" List all noble gases" );
121- });
115+ app .MapGet (" /" , async () => await service .Chat (" List all noble gases" ));
122116
123117app .Run ();
124118
@@ -167,10 +161,7 @@ Your program shoud now look like following:
167161``` csharp
168162using Azure .CloudMachine ;
169163using Azure .CloudMachine .OpenAI ;
170- using Azure .Provisioning .CloudMachine ;
171- using Azure .Provisioning .CloudMachine .OpenAI ;
172164using OpenAI .Chat ;
173- using System .ClientModel .TypeSpec ;
174165
175166if (CloudMachineInfrastructure .Configure (args , AssistantService .Configure )) return ;
176167
@@ -179,9 +170,7 @@ var app = builder.Build();
179170
180171var service = new AssistantService ();
181172app .Map (service );
182- app .MapGet (" /" , async () => {
183- return await service .Chat (" List all noble gasses" );
184- });
173+ app .MapGet (" /" , async () => await service .Chat (" List all noble gases" ));
185174
186175app .Run ();
187176
@@ -243,6 +232,11 @@ npm install @typespec/http-client-csharp
243232tsp compile .\server\tsp\AssistantService.tsp --emit "@typespec/http-client-csharp"
244233dotnet build tsp-output\@typespec\http-client-csharp\src\AssistantService.csproj
245234```
235+ You can also generate libraries for other languages, e.g.
236+ ``` dotnetcli
237+ npm install @typespec/http-client-python
238+ tsp compile .\server\tsp\AssistantService.tsp --emit "@typespec/http-client-python"
239+ ```
246240
247241#### Create command line client app for the service
248242``` dotnetcli
0 commit comments