-
Notifications
You must be signed in to change notification settings - Fork 5.1k
[Dup for Debug]Lusu/hosted agents #53742
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new Azure AI Agent Server SDK that provides infrastructure for hosting AI agents. The implementation includes a core framework for agent invocation, integration with Microsoft Agents AI library, and sample applications demonstrating various usage patterns.
Key changes:
- New Agent Server framework with core abstractions for agent invocation and response handling
- Agent Framework integration layer that bridges Microsoft Agents AI with the server infrastructure
- Multiple sample applications showing different integration patterns (minimal console, workflows, MCP integration, and custom implementations)
Reviewed Changes
Copilot reviewed 26 out of 718 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/ai/Azure.AI.AgentServer/src/Contracts/Azure.AI.AgentServer.Contracts.csproj | New project file for contracts library with analyzer suppressions |
| sdk/ai/Azure.AI.AgentServer/src/AgentFramework/Extensions/AIAgentExtensions.cs | Extension methods for running AI agents with dependency injection support |
| sdk/ai/Azure.AI.AgentServer/src/AgentFramework/Converters/ResponseConverterExtensions.cs | Converters for transforming agent responses to contract types |
| sdk/ai/Azure.AI.AgentServer/src/AgentFramework/Converters/RequestConverterExtensions.cs | Converters for transforming request contracts to AI framework types |
| sdk/ai/Azure.AI.AgentServer/src/AgentFramework/Converters/ItemResourceGenerator.cs | Streaming response generator for agent invocations |
| sdk/ai/Azure.AI.AgentServer/src/AgentFramework/Azure.AI.AgentServer.AgentFramework.csproj | Project file for Agent Framework integration layer |
| sdk/ai/Azure.AI.AgentServer/src/AgentFramework/AIAgentInvocation.cs | Main implementation of agent invocation with streaming support |
| sdk/ai/Azure.AI.AgentServer/samples/Directory.Build.props | Build properties for sample applications |
| sdk/ai/Azure.AI.AgentServer/samples/Customized/SimpleCustomized/* | Sample showing custom agent invocation implementation |
| sdk/ai/Azure.AI.AgentServer/samples/AgentFramework/MinimalConsole/* | Minimal sample demonstrating basic agent setup with tools |
| sdk/ai/Azure.AI.AgentServer/samples/AgentFramework/McpApiKey/* | Sample integrating MCP (Model Context Protocol) with GitHub |
| sdk/ai/Azure.AI.AgentServer/samples/AgentFramework/BasicWorkflow/* | Sample demonstrating workflow-based agent orchestration |
| sdk/ai/Azure.AI.AgentServer/Directory.Build.props | Root build properties for the entire Agent Server SDK |
| sdk/ai/Azure.AI.AgentServer/Azure.AI.AgentServer.sln | Solution file organizing all projects and samples |
| eng/Packages.Data.props | Package version definitions for Agent Server dependencies |
| { | ||
| if (sp.GetService<IAgentInvocation>() == null) | ||
| { | ||
| services.AddSingleton(agent ?? sp.GetRequiredService<AIAgent>()).AddSingleton<AIAgentInvocation>(); |
Copilot
AI
Nov 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When agent is null and AIAgent is not registered in the service provider, GetRequiredService<AIAgent>() will throw an exception, but the singleton registration for AIAgentInvocation will still be added to the services collection. The chained call should register AIAgentInvocation as IAgentInvocation to be consistent with the else branch on line 68.
| services.AddSingleton(agent ?? sp.GetRequiredService<AIAgent>()).AddSingleton<AIAgentInvocation>(); | |
| services.AddSingleton(agent ?? sp.GetRequiredService<AIAgent>()).AddSingleton<IAgentInvocation, AIAgentInvocation>(); |
| var aiContents = (content ?? ReadOnlyCollection<ItemContent>.Empty) | ||
| .Select(c => c is ItemContentInputText textContent ? textContent : null) | ||
| .Where(c => c != null) | ||
| .Select(AIContent (c) => new TextContent(c!.Text)) |
Copilot
AI
Nov 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect syntax - should be a lambda expression c => new TextContent(c!.Text) rather than AIContent (c) => new TextContent(c!.Text).
| .Select(AIContent (c) => new TextContent(c!.Text)) | |
| .Select(c => new TextContent(c!.Text)) |
jsquire
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is a debug PR, guarding to prevent accidental merge.
Contributing to the Azure SDK
Please see our CONTRIBUTING.md if you are not familiar with contributing to this repository or have questions.
For specific information about pull request etiquette and best practices, see this section.