Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Azure.Identity;
using Microsoft.Agents.AI;
using Microsoft.Agents.AI.Hosting.AGUI.AspNetCore;
using Microsoft.Agents.AI.OpenAI;
using Microsoft.Extensions.AI;
using OpenAI.Chat;

Expand All @@ -27,7 +28,7 @@
new DefaultAzureCredential())
.GetChatClient(deploymentName);

AIAgent agent = chatClient.AsIChatClient().AsAIAgent(
AIAgent agent = chatClient.AsAIAgent(
name: "AGUIAssistant",
instructions: "You are a helpful assistant.");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Azure.Identity;
using Microsoft.Agents.AI;
using Microsoft.Agents.AI.Hosting.AGUI.AspNetCore;
using Microsoft.Agents.AI.OpenAI;
using Microsoft.Extensions.AI;
using Microsoft.Extensions.Options;
using OpenAI.Chat;
Expand Down Expand Up @@ -82,7 +83,7 @@ static RestaurantSearchResponse SearchRestaurants(
new DefaultAzureCredential())
.GetChatClient(deploymentName);

ChatClientAgent agent = chatClient.AsIChatClient().AsAIAgent(
ChatClientAgent agent = chatClient.AsAIAgent(
name: "AGUIAssistant",
instructions: "You are a helpful assistant with access to restaurant information.",
tools: tools);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Azure.Identity;
using Microsoft.Agents.AI;
using Microsoft.Agents.AI.Hosting.AGUI.AspNetCore;
using Microsoft.Agents.AI.OpenAI;
using Microsoft.Extensions.AI;
using OpenAI.Chat;

Expand All @@ -27,7 +28,7 @@
new DefaultAzureCredential())
.GetChatClient(deploymentName);

AIAgent agent = chatClient.AsIChatClient().AsAIAgent(
AIAgent agent = chatClient.AsAIAgent(
name: "AGUIAssistant",
instructions: "You are a helpful assistant.");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Azure.Identity;
using Microsoft.Agents.AI;
using Microsoft.Agents.AI.Hosting.AGUI.AspNetCore;
using Microsoft.Agents.AI.OpenAI;
using Microsoft.AspNetCore.Http.Json;
using Microsoft.AspNetCore.HttpLogging;
using Microsoft.Extensions.AI;
Expand Down Expand Up @@ -60,7 +61,7 @@ static string ApproveExpenseReport(string expenseReportId)
new DefaultAzureCredential())
.GetChatClient(deploymentName);

ChatClientAgent baseAgent = openAIChatClient.AsIChatClient().AsAIAgent(
ChatClientAgent baseAgent = openAIChatClient.AsAIAgent(
name: "AGUIAssistant",
instructions: "You are a helpful assistant in charge of approving expenses",
tools: tools);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Azure.Identity;
using Microsoft.Agents.AI;
using Microsoft.Agents.AI.Hosting.AGUI.AspNetCore;
using Microsoft.Agents.AI.OpenAI;
using Microsoft.Extensions.AI;
using Microsoft.Extensions.Options;
using OpenAI.Chat;
Expand Down Expand Up @@ -37,7 +38,7 @@
new DefaultAzureCredential())
.GetChatClient(deploymentName);

AIAgent baseAgent = chatClient.AsIChatClient().AsAIAgent(
AIAgent baseAgent = chatClient.AsAIAgent(
name: "RecipeAgent",
instructions: """
You are a helpful recipe assistant. When users ask you to create or suggest a recipe,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using Azure.AI.OpenAI;
using Azure.Identity;
using Microsoft.Agents.AI;
using Microsoft.Agents.AI.OpenAI;
using Microsoft.Extensions.AI;
using ChatClient = OpenAI.Chat.ChatClient;

Expand Down Expand Up @@ -36,7 +37,7 @@
{
ChatClient chatClient = s_azureOpenAIClient!.GetChatClient(s_deploymentName!);

return chatClient.AsIChatClient().AsAIAgent(
return chatClient.AsAIAgent(

Check failure on line 40 in dotnet/samples/05-end-to-end/AGUIClientServer/AGUIDojoServer/ChatClientAgentFactory.cs

View workflow job for this annotation

GitHub Actions / dotnet-build (net9.0, windows-latest, Debug)

'ChatClient' does not contain a definition for 'AsAIAgent' and the best extension method overload 'ChatClientExtensions.AsAIAgent(IChatClient, string?, string?, string?, IList<AITool>?, ILoggerFactory?, IServiceProvider?)' requires a receiver of type 'Microsoft.Extensions.AI.IChatClient'

Check failure on line 40 in dotnet/samples/05-end-to-end/AGUIClientServer/AGUIDojoServer/ChatClientAgentFactory.cs

View workflow job for this annotation

GitHub Actions / dotnet-build (net9.0, windows-latest, Debug)

'ChatClient' does not contain a definition for 'AsAIAgent' and the best extension method overload 'ChatClientExtensions.AsAIAgent(IChatClient, string?, string?, string?, IList<AITool>?, ILoggerFactory?, IServiceProvider?)' requires a receiver of type 'Microsoft.Extensions.AI.IChatClient'

Check failure on line 40 in dotnet/samples/05-end-to-end/AGUIClientServer/AGUIDojoServer/ChatClientAgentFactory.cs

View workflow job for this annotation

GitHub Actions / dotnet-build (net8.0, ubuntu-latest, Release)

'ChatClient' does not contain a definition for 'AsAIAgent' and the best extension method overload 'ChatClientExtensions.AsAIAgent(IChatClient, string?, string?, string?, IList<AITool>?, ILoggerFactory?, IServiceProvider?)' requires a receiver of type 'Microsoft.Extensions.AI.IChatClient'

Check failure on line 40 in dotnet/samples/05-end-to-end/AGUIClientServer/AGUIDojoServer/ChatClientAgentFactory.cs

View workflow job for this annotation

GitHub Actions / dotnet-build (net8.0, ubuntu-latest, Release)

'ChatClient' does not contain a definition for 'AsAIAgent' and the best extension method overload 'ChatClientExtensions.AsAIAgent(IChatClient, string?, string?, string?, IList<AITool>?, ILoggerFactory?, IServiceProvider?)' requires a receiver of type 'Microsoft.Extensions.AI.IChatClient'

Check failure on line 40 in dotnet/samples/05-end-to-end/AGUIClientServer/AGUIDojoServer/ChatClientAgentFactory.cs

View workflow job for this annotation

GitHub Actions / dotnet-build (net10.0, ubuntu-latest, Release)

'ChatClient' does not contain a definition for 'AsAIAgent' and the best extension method overload 'ChatClientExtensions.AsAIAgent(IChatClient, string?, string?, string?, IList<AITool>?, ILoggerFactory?, IServiceProvider?)' requires a receiver of type 'Microsoft.Extensions.AI.IChatClient'

Check failure on line 40 in dotnet/samples/05-end-to-end/AGUIClientServer/AGUIDojoServer/ChatClientAgentFactory.cs

View workflow job for this annotation

GitHub Actions / dotnet-build (net10.0, ubuntu-latest, Release)

'ChatClient' does not contain a definition for 'AsAIAgent' and the best extension method overload 'ChatClientExtensions.AsAIAgent(IChatClient, string?, string?, string?, IList<AITool>?, ILoggerFactory?, IServiceProvider?)' requires a receiver of type 'Microsoft.Extensions.AI.IChatClient'

Check failure on line 40 in dotnet/samples/05-end-to-end/AGUIClientServer/AGUIDojoServer/ChatClientAgentFactory.cs

View workflow job for this annotation

GitHub Actions / dotnet-build (net472, windows-latest, Release)

'ChatClient' does not contain a definition for 'AsAIAgent' and the best extension method overload 'ChatClientExtensions.AsAIAgent(IChatClient, string?, string?, string?, IList<AITool>?, ILoggerFactory?, IServiceProvider?)' requires a receiver of type 'Microsoft.Extensions.AI.IChatClient'

Check failure on line 40 in dotnet/samples/05-end-to-end/AGUIClientServer/AGUIDojoServer/ChatClientAgentFactory.cs

View workflow job for this annotation

GitHub Actions / dotnet-build (net472, windows-latest, Release)

'ChatClient' does not contain a definition for 'AsAIAgent' and the best extension method overload 'ChatClientExtensions.AsAIAgent(IChatClient, string?, string?, string?, IList<AITool>?, ILoggerFactory?, IServiceProvider?)' requires a receiver of type 'Microsoft.Extensions.AI.IChatClient'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will require a reference to the Microsoft.Agents.AI.OpenAI project to compile.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the review! I've added the missing using Microsoft.Agents.AI.OpenAI; statements to all files that use chatClient.AsAIAgent().

The AsAIAgent() extension method is defined in the Microsoft.Agents.AI.OpenAI namespace, so this using statement is required for the code to compile when calling chatClient.AsAIAgent() directly.

Updated files:

  • dotnet/samples/02-agents/AGUI/Step01_GettingStarted/Server/Program.cs
  • dotnet/samples/02-agents/AGUI/Step02_BackendTools/Server/Program.cs
  • dotnet/samples/02-agents/AGUI/Step03_FrontendTools/Server/Program.cs
  • dotnet/samples/02-agents/AGUI/Step04_HumanInLoop/Server/Program.cs
  • dotnet/samples/02-agents/AGUI/Step05_StateManagement/Server/Program.cs
  • dotnet/samples/05-end-to-end/AGUIClientServer/AGUIDojoServer/ChatClientAgentFactory.cs
  • dotnet/samples/05-end-to-end/AGUIWebChat/Server/Program.cs

name: "AgenticChat",
description: "A simple chat agent using Azure OpenAI");
}
Expand All @@ -45,7 +46,7 @@
{
ChatClient chatClient = s_azureOpenAIClient!.GetChatClient(s_deploymentName!);

return chatClient.AsIChatClient().AsAIAgent(
return chatClient.AsAIAgent(

Check failure on line 49 in dotnet/samples/05-end-to-end/AGUIClientServer/AGUIDojoServer/ChatClientAgentFactory.cs

View workflow job for this annotation

GitHub Actions / dotnet-build (net9.0, windows-latest, Debug)

'ChatClient' does not contain a definition for 'AsAIAgent' and the best extension method overload 'ChatClientExtensions.AsAIAgent(IChatClient, string?, string?, string?, IList<AITool>?, ILoggerFactory?, IServiceProvider?)' requires a receiver of type 'Microsoft.Extensions.AI.IChatClient'

Check failure on line 49 in dotnet/samples/05-end-to-end/AGUIClientServer/AGUIDojoServer/ChatClientAgentFactory.cs

View workflow job for this annotation

GitHub Actions / dotnet-build (net9.0, windows-latest, Debug)

'ChatClient' does not contain a definition for 'AsAIAgent' and the best extension method overload 'ChatClientExtensions.AsAIAgent(IChatClient, string?, string?, string?, IList<AITool>?, ILoggerFactory?, IServiceProvider?)' requires a receiver of type 'Microsoft.Extensions.AI.IChatClient'

Check failure on line 49 in dotnet/samples/05-end-to-end/AGUIClientServer/AGUIDojoServer/ChatClientAgentFactory.cs

View workflow job for this annotation

GitHub Actions / dotnet-build (net8.0, ubuntu-latest, Release)

'ChatClient' does not contain a definition for 'AsAIAgent' and the best extension method overload 'ChatClientExtensions.AsAIAgent(IChatClient, string?, string?, string?, IList<AITool>?, ILoggerFactory?, IServiceProvider?)' requires a receiver of type 'Microsoft.Extensions.AI.IChatClient'

Check failure on line 49 in dotnet/samples/05-end-to-end/AGUIClientServer/AGUIDojoServer/ChatClientAgentFactory.cs

View workflow job for this annotation

GitHub Actions / dotnet-build (net8.0, ubuntu-latest, Release)

'ChatClient' does not contain a definition for 'AsAIAgent' and the best extension method overload 'ChatClientExtensions.AsAIAgent(IChatClient, string?, string?, string?, IList<AITool>?, ILoggerFactory?, IServiceProvider?)' requires a receiver of type 'Microsoft.Extensions.AI.IChatClient'

Check failure on line 49 in dotnet/samples/05-end-to-end/AGUIClientServer/AGUIDojoServer/ChatClientAgentFactory.cs

View workflow job for this annotation

GitHub Actions / dotnet-build (net10.0, ubuntu-latest, Release)

'ChatClient' does not contain a definition for 'AsAIAgent' and the best extension method overload 'ChatClientExtensions.AsAIAgent(IChatClient, string?, string?, string?, IList<AITool>?, ILoggerFactory?, IServiceProvider?)' requires a receiver of type 'Microsoft.Extensions.AI.IChatClient'

Check failure on line 49 in dotnet/samples/05-end-to-end/AGUIClientServer/AGUIDojoServer/ChatClientAgentFactory.cs

View workflow job for this annotation

GitHub Actions / dotnet-build (net10.0, ubuntu-latest, Release)

'ChatClient' does not contain a definition for 'AsAIAgent' and the best extension method overload 'ChatClientExtensions.AsAIAgent(IChatClient, string?, string?, string?, IList<AITool>?, ILoggerFactory?, IServiceProvider?)' requires a receiver of type 'Microsoft.Extensions.AI.IChatClient'

Check failure on line 49 in dotnet/samples/05-end-to-end/AGUIClientServer/AGUIDojoServer/ChatClientAgentFactory.cs

View workflow job for this annotation

GitHub Actions / dotnet-build (net472, windows-latest, Release)

'ChatClient' does not contain a definition for 'AsAIAgent' and the best extension method overload 'ChatClientExtensions.AsAIAgent(IChatClient, string?, string?, string?, IList<AITool>?, ILoggerFactory?, IServiceProvider?)' requires a receiver of type 'Microsoft.Extensions.AI.IChatClient'

Check failure on line 49 in dotnet/samples/05-end-to-end/AGUIClientServer/AGUIDojoServer/ChatClientAgentFactory.cs

View workflow job for this annotation

GitHub Actions / dotnet-build (net472, windows-latest, Release)

'ChatClient' does not contain a definition for 'AsAIAgent' and the best extension method overload 'ChatClientExtensions.AsAIAgent(IChatClient, string?, string?, string?, IList<AITool>?, ILoggerFactory?, IServiceProvider?)' requires a receiver of type 'Microsoft.Extensions.AI.IChatClient'
name: "BackendToolRenderer",
description: "An agent that can render backend tools using Azure OpenAI",
tools: [AIFunctionFactory.Create(
Expand All @@ -59,7 +60,7 @@
{
ChatClient chatClient = s_azureOpenAIClient!.GetChatClient(s_deploymentName!);

return chatClient.AsIChatClient().AsAIAgent(
return chatClient.AsAIAgent(

Check failure on line 63 in dotnet/samples/05-end-to-end/AGUIClientServer/AGUIDojoServer/ChatClientAgentFactory.cs

View workflow job for this annotation

GitHub Actions / dotnet-build (net9.0, windows-latest, Debug)

'ChatClient' does not contain a definition for 'AsAIAgent' and the best extension method overload 'ChatClientExtensions.AsAIAgent(IChatClient, string?, string?, string?, IList<AITool>?, ILoggerFactory?, IServiceProvider?)' requires a receiver of type 'Microsoft.Extensions.AI.IChatClient'

Check failure on line 63 in dotnet/samples/05-end-to-end/AGUIClientServer/AGUIDojoServer/ChatClientAgentFactory.cs

View workflow job for this annotation

GitHub Actions / dotnet-build (net9.0, windows-latest, Debug)

'ChatClient' does not contain a definition for 'AsAIAgent' and the best extension method overload 'ChatClientExtensions.AsAIAgent(IChatClient, string?, string?, string?, IList<AITool>?, ILoggerFactory?, IServiceProvider?)' requires a receiver of type 'Microsoft.Extensions.AI.IChatClient'

Check failure on line 63 in dotnet/samples/05-end-to-end/AGUIClientServer/AGUIDojoServer/ChatClientAgentFactory.cs

View workflow job for this annotation

GitHub Actions / dotnet-build (net8.0, ubuntu-latest, Release)

'ChatClient' does not contain a definition for 'AsAIAgent' and the best extension method overload 'ChatClientExtensions.AsAIAgent(IChatClient, string?, string?, string?, IList<AITool>?, ILoggerFactory?, IServiceProvider?)' requires a receiver of type 'Microsoft.Extensions.AI.IChatClient'

Check failure on line 63 in dotnet/samples/05-end-to-end/AGUIClientServer/AGUIDojoServer/ChatClientAgentFactory.cs

View workflow job for this annotation

GitHub Actions / dotnet-build (net8.0, ubuntu-latest, Release)

'ChatClient' does not contain a definition for 'AsAIAgent' and the best extension method overload 'ChatClientExtensions.AsAIAgent(IChatClient, string?, string?, string?, IList<AITool>?, ILoggerFactory?, IServiceProvider?)' requires a receiver of type 'Microsoft.Extensions.AI.IChatClient'

Check failure on line 63 in dotnet/samples/05-end-to-end/AGUIClientServer/AGUIDojoServer/ChatClientAgentFactory.cs

View workflow job for this annotation

GitHub Actions / dotnet-build (net10.0, ubuntu-latest, Release)

'ChatClient' does not contain a definition for 'AsAIAgent' and the best extension method overload 'ChatClientExtensions.AsAIAgent(IChatClient, string?, string?, string?, IList<AITool>?, ILoggerFactory?, IServiceProvider?)' requires a receiver of type 'Microsoft.Extensions.AI.IChatClient'

Check failure on line 63 in dotnet/samples/05-end-to-end/AGUIClientServer/AGUIDojoServer/ChatClientAgentFactory.cs

View workflow job for this annotation

GitHub Actions / dotnet-build (net10.0, ubuntu-latest, Release)

'ChatClient' does not contain a definition for 'AsAIAgent' and the best extension method overload 'ChatClientExtensions.AsAIAgent(IChatClient, string?, string?, string?, IList<AITool>?, ILoggerFactory?, IServiceProvider?)' requires a receiver of type 'Microsoft.Extensions.AI.IChatClient'

Check failure on line 63 in dotnet/samples/05-end-to-end/AGUIClientServer/AGUIDojoServer/ChatClientAgentFactory.cs

View workflow job for this annotation

GitHub Actions / dotnet-build (net472, windows-latest, Release)

'ChatClient' does not contain a definition for 'AsAIAgent' and the best extension method overload 'ChatClientExtensions.AsAIAgent(IChatClient, string?, string?, string?, IList<AITool>?, ILoggerFactory?, IServiceProvider?)' requires a receiver of type 'Microsoft.Extensions.AI.IChatClient'

Check failure on line 63 in dotnet/samples/05-end-to-end/AGUIClientServer/AGUIDojoServer/ChatClientAgentFactory.cs

View workflow job for this annotation

GitHub Actions / dotnet-build (net472, windows-latest, Release)

'ChatClient' does not contain a definition for 'AsAIAgent' and the best extension method overload 'ChatClientExtensions.AsAIAgent(IChatClient, string?, string?, string?, IList<AITool>?, ILoggerFactory?, IServiceProvider?)' requires a receiver of type 'Microsoft.Extensions.AI.IChatClient'
name: "HumanInTheLoopAgent",
description: "An agent that involves human feedback in its decision-making process using Azure OpenAI");
}
Expand All @@ -68,15 +69,15 @@
{
ChatClient chatClient = s_azureOpenAIClient!.GetChatClient(s_deploymentName!);

return chatClient.AsIChatClient().AsAIAgent(
return chatClient.AsAIAgent(

Check failure on line 72 in dotnet/samples/05-end-to-end/AGUIClientServer/AGUIDojoServer/ChatClientAgentFactory.cs

View workflow job for this annotation

GitHub Actions / dotnet-build (net9.0, windows-latest, Debug)

'ChatClient' does not contain a definition for 'AsAIAgent' and the best extension method overload 'ChatClientExtensions.AsAIAgent(IChatClient, string?, string?, string?, IList<AITool>?, ILoggerFactory?, IServiceProvider?)' requires a receiver of type 'Microsoft.Extensions.AI.IChatClient'

Check failure on line 72 in dotnet/samples/05-end-to-end/AGUIClientServer/AGUIDojoServer/ChatClientAgentFactory.cs

View workflow job for this annotation

GitHub Actions / dotnet-build (net8.0, ubuntu-latest, Release)

'ChatClient' does not contain a definition for 'AsAIAgent' and the best extension method overload 'ChatClientExtensions.AsAIAgent(IChatClient, string?, string?, string?, IList<AITool>?, ILoggerFactory?, IServiceProvider?)' requires a receiver of type 'Microsoft.Extensions.AI.IChatClient'

Check failure on line 72 in dotnet/samples/05-end-to-end/AGUIClientServer/AGUIDojoServer/ChatClientAgentFactory.cs

View workflow job for this annotation

GitHub Actions / dotnet-build (net10.0, ubuntu-latest, Release)

'ChatClient' does not contain a definition for 'AsAIAgent' and the best extension method overload 'ChatClientExtensions.AsAIAgent(IChatClient, string?, string?, string?, IList<AITool>?, ILoggerFactory?, IServiceProvider?)' requires a receiver of type 'Microsoft.Extensions.AI.IChatClient'

Check failure on line 72 in dotnet/samples/05-end-to-end/AGUIClientServer/AGUIDojoServer/ChatClientAgentFactory.cs

View workflow job for this annotation

GitHub Actions / dotnet-build (net472, windows-latest, Release)

'ChatClient' does not contain a definition for 'AsAIAgent' and the best extension method overload 'ChatClientExtensions.AsAIAgent(IChatClient, string?, string?, string?, IList<AITool>?, ILoggerFactory?, IServiceProvider?)' requires a receiver of type 'Microsoft.Extensions.AI.IChatClient'
name: "ToolBasedGenerativeUIAgent",
description: "An agent that uses tools to generate user interfaces using Azure OpenAI");
}

public static AIAgent CreateAgenticUI(JsonSerializerOptions options)
{
ChatClient chatClient = s_azureOpenAIClient!.GetChatClient(s_deploymentName!);
var baseAgent = chatClient.AsIChatClient().AsAIAgent(new ChatClientAgentOptions
var baseAgent = chatClient.AsAIAgent(new ChatClientAgentOptions

Check failure on line 80 in dotnet/samples/05-end-to-end/AGUIClientServer/AGUIDojoServer/ChatClientAgentFactory.cs

View workflow job for this annotation

GitHub Actions / dotnet-build (net9.0, windows-latest, Debug)

'ChatClient' does not contain a definition for 'AsAIAgent' and the best extension method overload 'ChatClientExtensions.AsAIAgent(IChatClient, string?, string?, string?, IList<AITool>?, ILoggerFactory?, IServiceProvider?)' requires a receiver of type 'Microsoft.Extensions.AI.IChatClient'

Check failure on line 80 in dotnet/samples/05-end-to-end/AGUIClientServer/AGUIDojoServer/ChatClientAgentFactory.cs

View workflow job for this annotation

GitHub Actions / dotnet-build (net8.0, ubuntu-latest, Release)

'ChatClient' does not contain a definition for 'AsAIAgent' and the best extension method overload 'ChatClientExtensions.AsAIAgent(IChatClient, string?, string?, string?, IList<AITool>?, ILoggerFactory?, IServiceProvider?)' requires a receiver of type 'Microsoft.Extensions.AI.IChatClient'

Check failure on line 80 in dotnet/samples/05-end-to-end/AGUIClientServer/AGUIDojoServer/ChatClientAgentFactory.cs

View workflow job for this annotation

GitHub Actions / dotnet-build (net10.0, ubuntu-latest, Release)

'ChatClient' does not contain a definition for 'AsAIAgent' and the best extension method overload 'ChatClientExtensions.AsAIAgent(IChatClient, string?, string?, string?, IList<AITool>?, ILoggerFactory?, IServiceProvider?)' requires a receiver of type 'Microsoft.Extensions.AI.IChatClient'

Check failure on line 80 in dotnet/samples/05-end-to-end/AGUIClientServer/AGUIDojoServer/ChatClientAgentFactory.cs

View workflow job for this annotation

GitHub Actions / dotnet-build (net472, windows-latest, Release)

'ChatClient' does not contain a definition for 'AsAIAgent' and the best extension method overload 'ChatClientExtensions.AsAIAgent(IChatClient, string?, string?, string?, IList<AITool>?, ILoggerFactory?, IServiceProvider?)' requires a receiver of type 'Microsoft.Extensions.AI.IChatClient'
{
Name = "AgenticUIAgent",
Description = "An agent that generates agentic user interfaces using Azure OpenAI",
Expand Down Expand Up @@ -119,7 +120,7 @@
{
ChatClient chatClient = s_azureOpenAIClient!.GetChatClient(s_deploymentName!);

var baseAgent = chatClient.AsIChatClient().AsAIAgent(
var baseAgent = chatClient.AsAIAgent(

Check failure on line 123 in dotnet/samples/05-end-to-end/AGUIClientServer/AGUIDojoServer/ChatClientAgentFactory.cs

View workflow job for this annotation

GitHub Actions / dotnet-build (net9.0, windows-latest, Debug)

'ChatClient' does not contain a definition for 'AsAIAgent' and the best extension method overload 'ChatClientExtensions.AsAIAgent(IChatClient, string?, string?, string?, IList<AITool>?, ILoggerFactory?, IServiceProvider?)' requires a receiver of type 'Microsoft.Extensions.AI.IChatClient'

Check failure on line 123 in dotnet/samples/05-end-to-end/AGUIClientServer/AGUIDojoServer/ChatClientAgentFactory.cs

View workflow job for this annotation

GitHub Actions / dotnet-build (net8.0, ubuntu-latest, Release)

'ChatClient' does not contain a definition for 'AsAIAgent' and the best extension method overload 'ChatClientExtensions.AsAIAgent(IChatClient, string?, string?, string?, IList<AITool>?, ILoggerFactory?, IServiceProvider?)' requires a receiver of type 'Microsoft.Extensions.AI.IChatClient'

Check failure on line 123 in dotnet/samples/05-end-to-end/AGUIClientServer/AGUIDojoServer/ChatClientAgentFactory.cs

View workflow job for this annotation

GitHub Actions / dotnet-build (net10.0, ubuntu-latest, Release)

'ChatClient' does not contain a definition for 'AsAIAgent' and the best extension method overload 'ChatClientExtensions.AsAIAgent(IChatClient, string?, string?, string?, IList<AITool>?, ILoggerFactory?, IServiceProvider?)' requires a receiver of type 'Microsoft.Extensions.AI.IChatClient'

Check failure on line 123 in dotnet/samples/05-end-to-end/AGUIClientServer/AGUIDojoServer/ChatClientAgentFactory.cs

View workflow job for this annotation

GitHub Actions / dotnet-build (net472, windows-latest, Release)

'ChatClient' does not contain a definition for 'AsAIAgent' and the best extension method overload 'ChatClientExtensions.AsAIAgent(IChatClient, string?, string?, string?, IList<AITool>?, ILoggerFactory?, IServiceProvider?)' requires a receiver of type 'Microsoft.Extensions.AI.IChatClient'
name: "SharedStateAgent",
description: "An agent that demonstrates shared state patterns using Azure OpenAI");

Expand All @@ -130,7 +131,7 @@
{
ChatClient chatClient = s_azureOpenAIClient!.GetChatClient(s_deploymentName!);

var baseAgent = chatClient.AsIChatClient().AsAIAgent(new ChatClientAgentOptions
var baseAgent = chatClient.AsAIAgent(new ChatClientAgentOptions

Check failure on line 134 in dotnet/samples/05-end-to-end/AGUIClientServer/AGUIDojoServer/ChatClientAgentFactory.cs

View workflow job for this annotation

GitHub Actions / dotnet-build (net9.0, windows-latest, Debug)

'ChatClient' does not contain a definition for 'AsAIAgent' and the best extension method overload 'ChatClientExtensions.AsAIAgent(IChatClient, string?, string?, string?, IList<AITool>?, ILoggerFactory?, IServiceProvider?)' requires a receiver of type 'Microsoft.Extensions.AI.IChatClient'

Check failure on line 134 in dotnet/samples/05-end-to-end/AGUIClientServer/AGUIDojoServer/ChatClientAgentFactory.cs

View workflow job for this annotation

GitHub Actions / dotnet-build (net8.0, ubuntu-latest, Release)

'ChatClient' does not contain a definition for 'AsAIAgent' and the best extension method overload 'ChatClientExtensions.AsAIAgent(IChatClient, string?, string?, string?, IList<AITool>?, ILoggerFactory?, IServiceProvider?)' requires a receiver of type 'Microsoft.Extensions.AI.IChatClient'

Check failure on line 134 in dotnet/samples/05-end-to-end/AGUIClientServer/AGUIDojoServer/ChatClientAgentFactory.cs

View workflow job for this annotation

GitHub Actions / dotnet-build (net10.0, ubuntu-latest, Release)

'ChatClient' does not contain a definition for 'AsAIAgent' and the best extension method overload 'ChatClientExtensions.AsAIAgent(IChatClient, string?, string?, string?, IList<AITool>?, ILoggerFactory?, IServiceProvider?)' requires a receiver of type 'Microsoft.Extensions.AI.IChatClient'

Check failure on line 134 in dotnet/samples/05-end-to-end/AGUIClientServer/AGUIDojoServer/ChatClientAgentFactory.cs

View workflow job for this annotation

GitHub Actions / dotnet-build (net472, windows-latest, Release)

'ChatClient' does not contain a definition for 'AsAIAgent' and the best extension method overload 'ChatClientExtensions.AsAIAgent(IChatClient, string?, string?, string?, IList<AITool>?, ILoggerFactory?, IServiceProvider?)' requires a receiver of type 'Microsoft.Extensions.AI.IChatClient'
{
Name = "PredictiveStateUpdatesAgent",
Description = "An agent that demonstrates predictive state updates using Azure OpenAI",
Expand Down
4 changes: 2 additions & 2 deletions dotnet/samples/05-end-to-end/AGUIWebChat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ AzureOpenAIClient azureOpenAIClient = new AzureOpenAIClient(
ChatClient chatClient = azureOpenAIClient.GetChatClient(deploymentName);

// Create AI agent
ChatClientAgent agent = chatClient.AsIChatClient().AsAIAgent(
ChatClientAgent agent = chatClient.AsAIAgent(
name: "ChatAssistant",
instructions: "You are a helpful assistant.");

Expand Down Expand Up @@ -162,7 +162,7 @@ dotnet run
Edit the instructions in `Server/Program.cs`:

```csharp
ChatClientAgent agent = chatClient.AsIChatClient().AsAIAgent(
ChatClientAgent agent = chatClient.AsAIAgent(
name: "ChatAssistant",
instructions: "You are a helpful coding assistant specializing in C# and .NET.");
```
Expand Down
3 changes: 2 additions & 1 deletion dotnet/samples/05-end-to-end/AGUIWebChat/Server/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Azure.Identity;
using Microsoft.Agents.AI;
using Microsoft.Agents.AI.Hosting.AGUI.AspNetCore;
using Microsoft.Agents.AI.OpenAI;
using Microsoft.Extensions.AI;
using OpenAI.Chat;

Expand All @@ -28,7 +29,7 @@

ChatClient chatClient = azureOpenAIClient.GetChatClient(deploymentName);

ChatClientAgent agent = chatClient.AsIChatClient().AsAIAgent(
ChatClientAgent agent = chatClient.AsAIAgent(
name: "ChatAssistant",
instructions: "You are a helpful assistant.");

Expand Down
Loading