Skip to content

Commit b07f953

Browse files
authored
Update code-interpreter-samples.md
Addressing feedback.
1 parent 709e76d commit b07f953

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

articles/ai-services/agents/how-to/tools/code-interpreter-samples.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,13 @@ for image_content in messages.image_contents:
144144

145145
:::zone pivot="csharp"
146146

147-
# How to use the code interpreter tool
147+
## Using the .NET SDK
148148

149149
In this example we will demonstrate the Agent streaming support, code interpreter creating an image and downloading and viewing the image.
150150

151151
1. First, we set up configuration using `appsettings.json`, create a `PersistentAgentsClient`, and then create a `PersistentAgent` with the Code Interpreter tool.
152152

153-
```C# Snippet:AgentsStreaming_Step1_Common_SetupClientAndConfig
153+
```csharp
154154
using Azure;
155155
using Azure.AI.Agents.Persistent;
156156
using Azure.Identity;
@@ -170,7 +170,7 @@ PersistentAgentsClient client = new(projectEndpoint, new DefaultAzureCredential(
170170

171171
Synchronous sample:
172172

173-
```C# Snippet:AgentsStreaming_Step1_Sync_CreateAgent
173+
```csharp
174174
PersistentAgent agent = client.Administration.CreateAgent(
175175
model: modelDeploymentName,
176176
name: "My Friendly Test Agent",
@@ -181,7 +181,7 @@ PersistentAgent agent = client.Administration.CreateAgent(
181181

182182
Asynchronous sample:
183183

184-
```C# Snippet:AgentsStreaming_Step1_Async_CreateAgent
184+
```csharp
185185
PersistentAgent agent = await client.Administration.CreateAgentAsync(
186186
model: modelDeploymentName,
187187
name: "My Friendly Test Agent",
@@ -194,7 +194,7 @@ PersistentAgent agent = await client.Administration.CreateAgentAsync(
194194

195195
Synchronous sample:
196196

197-
```C# Snippet:AgentsStreaming_Step2_Sync_CreateThreadAndMessage
197+
```csharp
198198
PersistentAgentThread thread = client.Threads.CreateThread();
199199

200200
client.Messages.CreateMessage(
@@ -205,7 +205,7 @@ client.Messages.CreateMessage(
205205

206206
Asynchronous sample:
207207

208-
```C# Snippet:AgentsStreaming_Step2_Async_CreateThreadAndMessage
208+
```csharp
209209
PersistentAgentThread thread = await client.Threads.CreateThreadAsync();
210210

211211
await client.Messages.CreateMessageAsync(
@@ -218,7 +218,7 @@ await client.Messages.CreateMessageAsync(
218218

219219
Synchronous sample:
220220

221-
```C# Snippet:AgentsStreaming_Step3_Sync_CreateAndPollRun
221+
```csharp
222222
ThreadRun run = client.Runs.CreateRun(
223223
thread.Id,
224224
agent.Id,
@@ -236,7 +236,7 @@ while (run.Status == RunStatus.Queued
236236

237237
Asynchronous sample:
238238

239-
```C# Snippet:AgentsStreaming_Step3_Async_CreateAndPollRun
239+
```csharp
240240
ThreadRun run = await client.Runs.CreateRunAsync(
241241
thread.Id,
242242
agent.Id,
@@ -256,7 +256,7 @@ while (run.Status == RunStatus.Queued
256256

257257
Synchronous sample:
258258

259-
```C# Snippet:AgentsStreaming_Step4_Sync_ProcessMessages
259+
```csharp
260260
Pageable<ThreadMessage> messages = client.Messages.GetMessages(
261261
threadId: thread.Id,
262262
order: ListSortOrder.Ascending);
@@ -291,7 +291,7 @@ foreach (ThreadMessage threadMessage in messages)
291291

292292
Asynchronous sample:
293293

294-
```C# Snippet:AgentsStreaming_Step4_Async_ProcessMessages
294+
```csharp
295295
AsyncPageable<ThreadMessage> messages = client.Messages.GetMessagesAsync(
296296
threadId: thread.Id,
297297
order: ListSortOrder.Ascending);
@@ -328,14 +328,14 @@ await foreach (ThreadMessage threadMessage in messages)
328328

329329
Synchronous sample:
330330

331-
```C# Snippet:AgentsStreaming_Step5_Sync_Cleanup
331+
```csharp
332332
client.Threads.DeleteThread(threadId: thread.Id);
333333
client.Administration.DeleteAgent(agentId: agent.Id);
334334
```
335335

336336
Asynchronous sample:
337337

338-
```C# Snippet:AgentsStreaming_Step5_Async_Cleanup
338+
```csharp
339339
await client.Threads.DeleteThreadAsync(threadId: thread.Id);
340340
await client.Administration.DeleteAgentAsync(agentId: agent.Id);
341341
```

0 commit comments

Comments
 (0)