Skip to content

Conversation

@lusu-msft
Copy link

Description

Please add an informative description that covers that changes made by the pull request and link all relevant issues.

If an SDK is being regenerated based on a new API spec, a link to the pull request containing these API spec changes should be included above.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

Copilot AI review requested due to automatic review settings November 5, 2025 06:24
@github-actions github-actions bot added the AI label Nov 5, 2025
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 comprehensive Azure AI Agent Server implementation with LangGraph integration, consisting of two main packages:

  • azure-ai-agentserver-core: Core agent server infrastructure
  • azure-ai-agentserver-langgraph: LangGraph adapter for hosting LangGraph agents

Key Changes:

  • Added core agent server framework with OpenTelemetry tracing, streaming support, and event-driven architecture
  • Implemented LangGraph adapter to convert between LangGraph state and OpenAI-style responses
  • Included multiple samples demonstrating different use cases (simple agents, MCP integration, RAG patterns, Redis checkpointing)

Reviewed Changes

Copilot reviewed 108 out of 113 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
sdk/ai/ci.yml Added azure-ai-agentserver-core to CI pipeline
sdk/ai/azure-ai-agentserver-langgraph/pyproject.toml Package configuration with dependencies on LangChain/LangGraph
sdk/ai/azure-ai-agentserver-langgraph/azure/ai/agentserver/langgraph/*.py Core LangGraph adapter implementation with request/response converters
sdk/ai/azure-ai-agentserver-langgraph/samples/*/main.py Sample applications showing various agent patterns
sdk/ai/azure-ai-agentserver-langgraph/tests/unit_tests/*.py Unit tests for request conversion
sdk/ai/azure-ai-agentserver-core/azure/ai/agentserver/core/server/base.py Base agent server with Starlette/Uvicorn
sdk/ai/azure-ai-agentserver-core/samples/*/main.py Custom agent samples (mock, MCP, bilingual planner)
sdk/ai/azure-ai-agentserver-core/tests/*.py Test infrastructure for gated tests
Comments suppressed due to low confidence (1)

sdk/ai/azure-ai-agentserver-langgraph/samples/agent_calculator/langgraph_agent_calculator.py:1

  • The import statement is incorrect. For LangGraph >= 1.0.0, the correct import should be from langgraph.prebuilt import create_react_agent, not from langchain.agents import create_agent. This will cause an ImportError at runtime.

def calculator(expression: str) -> str:
"""Evaluates mathematical expression"""
try:
maths_result = eval(expression)
Copy link

Copilot AI Nov 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using eval() on user input is a security vulnerability that allows arbitrary code execution. Replace with ast.literal_eval() for safe mathematical expression evaluation, or use a dedicated math parser library like simpleeval or numexpr.

Copilot uses AI. Check for mistakes.
def calculator(expression: str) -> str:
"""Evaluates mathematical expression"""
try:
maths_result = eval(expression)
Copy link

Copilot AI Nov 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using eval() on user input is a security vulnerability that allows arbitrary code execution. Replace with ast.literal_eval() for safe mathematical expression evaluation, or use a dedicated math parser library like simpleeval or numexpr.

Copilot uses AI. Check for mistakes.

return create_react_agent(model, tools)
else:
from langchain.agents import create_agent
Copy link

Copilot AI Nov 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The import statement is incorrect. For LangGraph >= 1.0.0, the correct import should be from langgraph.prebuilt import create_react_agent, not from langchain.agents import create_agent. This will cause an ImportError at runtime.

Copilot uses AI. Check for mistakes.
@github-actions
Copy link

github-actions bot commented Nov 5, 2025

API Change Check

APIView identified API level changes in this PR and created the following API reviews

azure-ai-agentserver-core

@lusu-msft lusu-msft closed this Nov 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants