Skip to content

Conversation

@lusu-msft
Copy link
Member

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.

Copy link
Contributor

Copilot AI left a 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>();
Copy link

Copilot AI Nov 6, 2025

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.

Suggested change
services.AddSingleton(agent ?? sp.GetRequiredService<AIAgent>()).AddSingleton<AIAgentInvocation>();
services.AddSingleton(agent ?? sp.GetRequiredService<AIAgent>()).AddSingleton<IAgentInvocation, AIAgentInvocation>();

Copilot uses AI. Check for mistakes.
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))
Copy link

Copilot AI Nov 6, 2025

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).

Suggested change
.Select(AIContent (c) => new TextContent(c!.Text))
.Select(c => new TextContent(c!.Text))

Copilot uses AI. Check for mistakes.
Copy link
Member

@jsquire jsquire left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants