mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Fix tests
This commit is contained in:
@@ -26,18 +26,18 @@ app.UseHttpLogging();
|
||||
ChatClientAgentFactory.Initialize(app.Configuration);
|
||||
|
||||
// Map the AG-UI agent endpoints for different scenarios
|
||||
app.MapAGUI("/agentic_chat", ChatClientAgentFactory.CreateAgenticChat());
|
||||
app.MapAGUI(ChatClientAgentFactory.CreateAgenticChat(), "/agentic_chat");
|
||||
|
||||
app.MapAGUI("/backend_tool_rendering", ChatClientAgentFactory.CreateBackendToolRendering());
|
||||
app.MapAGUI(ChatClientAgentFactory.CreateBackendToolRendering(), "/backend_tool_rendering");
|
||||
|
||||
app.MapAGUI("/human_in_the_loop", ChatClientAgentFactory.CreateHumanInTheLoop());
|
||||
app.MapAGUI(ChatClientAgentFactory.CreateHumanInTheLoop(), "/human_in_the_loop");
|
||||
|
||||
app.MapAGUI("/tool_based_generative_ui", ChatClientAgentFactory.CreateToolBasedGenerativeUI());
|
||||
app.MapAGUI(ChatClientAgentFactory.CreateToolBasedGenerativeUI(), "/tool_based_generative_ui");
|
||||
|
||||
app.MapAGUI("/agentic_generative_ui", ChatClientAgentFactory.CreateAgenticUI());
|
||||
app.MapAGUI(ChatClientAgentFactory.CreateAgenticUI(), "/agentic_generative_ui");
|
||||
|
||||
var jsonOptions = app.Services.GetRequiredService<IOptions<Microsoft.AspNetCore.Http.Json.JsonOptions>>();
|
||||
app.MapAGUI("/shared_state", ChatClientAgentFactory.CreateSharedState(jsonOptions.Value.SerializerOptions));
|
||||
app.MapAGUI(ChatClientAgentFactory.CreateSharedState(jsonOptions.Value.SerializerOptions), "/shared_state");
|
||||
|
||||
await app.RunAsync();
|
||||
|
||||
|
||||
@@ -45,6 +45,6 @@ var agent = new AzureOpenAIClient(
|
||||
]);
|
||||
|
||||
// Map the AG-UI agent endpoint
|
||||
app.MapAGUI("/", agent);
|
||||
app.MapAGUI(agent, "/");
|
||||
|
||||
await app.RunAsync();
|
||||
|
||||
+1
-1
@@ -252,7 +252,7 @@ public sealed class BasicStreamingTests : IAsyncDisposable
|
||||
? this._app.Services.GetRequiredService<FakeMultiMessageAgent>()
|
||||
: this._app.Services.GetRequiredService<FakeChatClientAgent>();
|
||||
|
||||
this._app.MapAGUI("/agent", agent);
|
||||
this._app.MapAGUI(agent, "/agent");
|
||||
|
||||
await this._app.StartAsync();
|
||||
|
||||
|
||||
+1
-1
@@ -316,7 +316,7 @@ public sealed class SharedStateTests : IAsyncDisposable
|
||||
|
||||
this._app = builder.Build();
|
||||
|
||||
this._app.MapAGUI("/agent", fakeAgent);
|
||||
this._app.MapAGUI(fakeAgent, "/agent");
|
||||
|
||||
await this._app.StartAsync();
|
||||
|
||||
|
||||
+1
-1
@@ -519,7 +519,7 @@ public sealed class ToolCallingTests : IAsyncDisposable
|
||||
// FakeChatClient will receive options.Tools containing both server and client tools (merged by framework)
|
||||
var fakeChatClient = new FakeToolCallingChatClient(triggerParallelCalls, this._output, jsonSerializerOptions: jsonSerializerOptions);
|
||||
AIAgent baseAgent = fakeChatClient.CreateAIAgent(instructions: null, name: "base-agent", description: "A base agent for tool testing", tools: serverTools ?? []);
|
||||
this._app.MapAGUI("/agent", baseAgent);
|
||||
this._app.MapAGUI(baseAgent, "/agent");
|
||||
|
||||
await this._app.StartAsync();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user