Skip to content

Commit e97b1b3

Browse files
committed
Fix GetChatClient -> GetProjectOpenAIClient().GetProjectResponsesClient().AsIChatClient() in 8 files
1 parent a28e1d7 commit e97b1b3

8 files changed

Lines changed: 31 additions & 19 deletions

File tree

agent-framework/agents/agent-pipeline.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,9 @@ The chat client layer handles the actual communication with the LLM service.
158158

159159
```csharp
160160
var chatClient = new AIProjectClient(endpoint, credential)
161-
.GetChatClient(deploymentName)
162-
.AsIChatClient()
161+
.GetProjectOpenAIClient()
162+
.GetProjectResponsesClient()
163+
.AsIChatClient(deploymentName)
163164
.AsBuilder()
164165
.Use(CustomChatClientMiddleware)
165166
.Build();
@@ -171,8 +172,9 @@ You can also use `AIContextProvider` as chat client middleware to enrich message
171172

172173
```csharp
173174
var chatClient = new AIProjectClient(endpoint, credential)
174-
.GetChatClient(deploymentName)
175-
.AsIChatClient()
175+
.GetProjectOpenAIClient()
176+
.GetProjectResponsesClient()
177+
.AsIChatClient(deploymentName)
176178
.AsBuilder()
177179
.UseAIContextProviders(new MyContextProvider())
178180
.Build();

agent-framework/agents/index.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,7 @@ Once you have created the OpenAIClient, you can get a sub client for the specifi
139139

140140
```csharp
141141
AIAgent agent = client
142-
.GetChatClient(model)
143-
.AsAIAgent(instructions: "You are good at telling jokes.", name: "Joker");
142+
.AsAIAgent(model: model, instructions: "You are good at telling jokes.", name: "Joker");
144143
```
145144

146145
### Using the Azure AI Projects SDK

agent-framework/agents/observability.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ To enable observability for your chat client, you need to build the chat client
2828
```csharp
2929
// Using the AIProjectClient as an example
3030
var instrumentedChatClient = new AIProjectClient(new Uri(endpoint), new DefaultAzureCredential())
31-
.GetChatClient(deploymentName)
32-
.AsIChatClient() // Converts into a Microsoft.Extensions.AI.IChatClient
31+
.GetProjectOpenAIClient()
32+
.GetProjectResponsesClient()
33+
.AsIChatClient(deploymentName) // Converts into a Microsoft.Extensions.AI.IChatClient
3334
.AsBuilder()
3435
.UseOpenTelemetry(sourceName: SourceName, configure: (cfg) => cfg.EnableSensitiveData = true) // Enable OpenTelemetry instrumentation with sensitive data
3536
.Build();

agent-framework/workflows/edges.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ public static class Program
354354
?? throw new Exception("AZURE_OPENAI_ENDPOINT is not set.");
355355
var deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT_NAME") ?? "gpt-4o-mini";
356356
var chatClient = new AIProjectClient(new Uri(endpoint), new DefaultAzureCredential())
357-
.GetChatClient(deploymentName).AsIChatClient();
357+
.GetProjectOpenAIClient().GetProjectResponsesClient().AsIChatClient(deploymentName);
358358

359359
// Create agents
360360
AIAgent spamDetectionAgent = GetSpamDetectionAgent(chatClient);
@@ -973,7 +973,10 @@ public static class Program
973973
// Set up the Azure OpenAI client
974974
var endpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT") ?? throw new Exception("AZURE_OPENAI_ENDPOINT is not set.");
975975
var deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT_NAME") ?? "gpt-4o-mini";
976-
var chatClient = new AIProjectClient(new Uri(endpoint), new DefaultAzureCredential()).GetChatClient(deploymentName).AsIChatClient();
976+
var chatClient = new AIProjectClient(new Uri(endpoint), new DefaultAzureCredential())
977+
.GetProjectOpenAIClient()
978+
.GetProjectResponsesClient()
979+
.AsIChatClient(deploymentName);
977980

978981
// Create agents
979982
AIAgent spamDetectionAgent = GetSpamDetectionAgent(chatClient);
@@ -1721,7 +1724,10 @@ public static class Program
17211724
// Set up the Azure OpenAI client
17221725
var endpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT") ?? throw new Exception("AZURE_OPENAI_ENDPOINT is not set.");
17231726
var deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT_NAME") ?? "gpt-4o-mini";
1724-
var chatClient = new AIProjectClient(new Uri(endpoint), new DefaultAzureCredential()).GetChatClient(deploymentName).AsIChatClient();
1727+
var chatClient = new AIProjectClient(new Uri(endpoint), new DefaultAzureCredential())
1728+
.GetProjectOpenAIClient()
1729+
.GetProjectResponsesClient()
1730+
.AsIChatClient(deploymentName);
17251731

17261732
// Create agents
17271733
AIAgent emailAnalysisAgent = GetEmailAnalysisAgent(chatClient);

agent-framework/workflows/orchestrations/concurrent.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@ var endpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT") ??
5959
throw new InvalidOperationException("AZURE_OPENAI_ENDPOINT is not set.");
6060
var deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT_NAME") ?? "gpt-4o-mini";
6161
var client = new AIProjectClient(new Uri(endpoint), new DefaultAzureCredential())
62-
.GetChatClient(deploymentName)
63-
.AsIChatClient();
62+
.GetProjectOpenAIClient()
63+
.GetProjectResponsesClient()
64+
.AsIChatClient(deploymentName);
6465
```
6566

6667
> [!WARNING]

agent-framework/workflows/orchestrations/group-chat.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,9 @@ var endpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT") ??
7171
throw new InvalidOperationException("AZURE_OPENAI_ENDPOINT is not set.");
7272
var deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT_NAME") ?? "gpt-4o-mini";
7373
var client = new AIProjectClient(new Uri(endpoint), new DefaultAzureCredential())
74-
.GetChatClient(deploymentName)
75-
.AsIChatClient();
74+
.GetProjectOpenAIClient()
75+
.GetProjectResponsesClient()
76+
.AsIChatClient(deploymentName);
7677
```
7778

7879
> [!WARNING]

agent-framework/workflows/orchestrations/handoff.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,9 @@ var endpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT") ??
7777
throw new InvalidOperationException("AZURE_OPENAI_ENDPOINT is not set.");
7878
var deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT_NAME") ?? "gpt-4o-mini";
7979
var client = new AIProjectClient(new Uri(endpoint), new DefaultAzureCredential())
80-
.GetChatClient(deploymentName)
81-
.AsIChatClient();
80+
.GetProjectOpenAIClient()
81+
.GetProjectResponsesClient()
82+
.AsIChatClient(deploymentName);
8283
```
8384

8485
> [!WARNING]

agent-framework/workflows/orchestrations/sequential.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,9 @@ var endpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT") ??
6767
throw new InvalidOperationException("AZURE_OPENAI_ENDPOINT is not set.");
6868
var deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT_NAME") ?? "gpt-4o-mini";
6969
var client = new AIProjectClient(new Uri(endpoint), new DefaultAzureCredential())
70-
.GetChatClient(deploymentName)
71-
.AsIChatClient();
70+
.GetProjectOpenAIClient()
71+
.GetProjectResponsesClient()
72+
.AsIChatClient(deploymentName);
7273
```
7374

7475
> [!WARNING]

0 commit comments

Comments
 (0)