mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
point URL to agent, not to agentcard (#3176)
This commit is contained in:
committed by
GitHub
Unverified
parent
9c094573e8
commit
5faa2851bb
@@ -90,13 +90,7 @@ public static class AIAgentExtensions
|
||||
// we can help user if they did not set Url explicitly.
|
||||
if (string.IsNullOrEmpty(agentCard.Url))
|
||||
{
|
||||
var agentCardUrl = context.TrimEnd('/');
|
||||
if (!context.EndsWith("/v1/card", StringComparison.Ordinal))
|
||||
{
|
||||
agentCardUrl += "/v1/card";
|
||||
}
|
||||
|
||||
agentCard.Url = agentCardUrl;
|
||||
agentCard.Url = context.TrimEnd('/');
|
||||
}
|
||||
|
||||
return Task.FromResult(agentCard);
|
||||
|
||||
@@ -77,7 +77,9 @@ public sealed class A2AIntegrationTests
|
||||
Assert.NotNull(url);
|
||||
Assert.NotEmpty(url);
|
||||
Assert.StartsWith("http", url, StringComparison.OrdinalIgnoreCase);
|
||||
Assert.Equal($"{testServer.BaseAddress.ToString().TrimEnd('/')}/a2a/test-agent/v1/card", url);
|
||||
|
||||
// agentCard's URL matches the agent endpoint
|
||||
Assert.Equal($"{testServer.BaseAddress.ToString().TrimEnd('/')}/a2a/test-agent", url);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user