mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
.NET: [BREAKING] Change implementation to use AsFunctionTool extension method to create a function from an agent (#686)
* Change implementation to use AsFunctionTool extension method to create a function from an agent * Update dotnet/tests/Microsoft.Extensions.AI.Agents.UnitTests/AgentExtensionsTests.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Address code review feedback and add a new sample * Address some code review feedback --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
Unverified
parent
2a75482777
commit
636e3acf37
@@ -25,7 +25,7 @@ internal sealed class HostClientAgent
|
||||
// Connect to the remote agents via A2A
|
||||
var createAgentTasks = agentUrls.Select(agentUrl => this.CreateAgentAsync(agentUrl));
|
||||
var agents = await Task.WhenAll(createAgentTasks);
|
||||
var tools = agents.Select(agent => (AITool)AgentAIFunctionFactory.CreateFromAgent(agent)).ToList();
|
||||
var tools = agents.Select(agent => (AITool)agent.AsAIFunction()).ToList();
|
||||
|
||||
// Create the agent that uses the remote agents as tools
|
||||
this.Agent = new OpenAIClient(new ApiKeyCredential(apiKey))
|
||||
|
||||
Reference in New Issue
Block a user