Skip to content

Commit 22109d2

Browse files
Update CM README.MD (Azure#47036)
1 parent e8ac77d commit 22109d2

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

sdk/cloudmachine/README.MD

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -98,16 +98,12 @@ class AssistantService {
9898
Lastly, create an instance of the service and call the `Chat` method when the app users browses the app:
9999
```csharp
100100
var 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
```
105103
The full program should look like following:
106104
```csharp
107105
using Azure.CloudMachine;
108106
using Azure.CloudMachine.OpenAI;
109-
using Azure.Provisioning.CloudMachine;
110-
using Azure.Provisioning.CloudMachine.OpenAI;
111107
using OpenAI.Chat;
112108

113109
if (CloudMachineInfrastructure.Configure(args, AssistantService.Configure)) return;
@@ -116,9 +112,7 @@ var builder = WebApplication.CreateBuilder(args);
116112
var app = builder.Build();
117113

118114
var 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

123117
app.Run();
124118

@@ -167,10 +161,7 @@ Your program shoud now look like following:
167161
```csharp
168162
using Azure.CloudMachine;
169163
using Azure.CloudMachine.OpenAI;
170-
using Azure.Provisioning.CloudMachine;
171-
using Azure.Provisioning.CloudMachine.OpenAI;
172164
using OpenAI.Chat;
173-
using System.ClientModel.TypeSpec;
174165

175166
if (CloudMachineInfrastructure.Configure(args, AssistantService.Configure)) return;
176167

@@ -179,9 +170,7 @@ var app = builder.Build();
179170

180171
var service = new AssistantService();
181172
app.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

186175
app.Run();
187176

@@ -243,6 +232,11 @@ npm install @typespec/http-client-csharp
243232
tsp compile .\server\tsp\AssistantService.tsp --emit "@typespec/http-client-csharp"
244233
dotnet 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

Comments
 (0)