-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Python: Add BaseAgent implementation for Claude Agent SDK #3509
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 adds support for the Claude Agent SDK integration to the Agent Framework by introducing the agent-framework-claude package. It enables developers to use Claude's agentic capabilities (via Claude Code CLI) within the Agent Framework, including tool use, session management, and streaming responses.
Changes:
- Added new
agent-framework-claudepackage withClaudeAgentimplementation that wraps the Claude Agent SDK - Integrated Claude Agent exports into the
agent_framework.anthropicnamespace for easy access - Added comprehensive unit tests covering agent initialization, session management, tool conversion, and streaming
- Provided 7 sample files demonstrating various Claude Agent features (basic usage, tools, permissions, MCP, sessions)
Reviewed changes
Copilot reviewed 19 out of 20 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
python/uv.lock |
Added claude-agent-sdk dependency (v0.1.25) and updated package list to include agent-framework-claude |
python/pyproject.toml |
Added agent-framework-claude to workspace members |
python/packages/claude/pyproject.toml |
Package configuration for new agent-framework-claude package with dependencies and build settings |
python/packages/claude/agent_framework_claude/__init__.py |
Package initialization exporting ClaudeAgent, ClaudeAgentOptions, and ClaudeAgentSettings |
python/packages/claude/agent_framework_claude/_agent.py |
Core ClaudeAgent implementation with session management, tool conversion, and streaming support |
python/packages/claude/agent_framework_claude/_settings.py |
Settings class for Claude Agent configuration via environment variables |
python/packages/claude/tests/test_claude_agent.py |
Comprehensive unit tests (709 lines) covering all agent functionality |
python/packages/core/agent_framework/anthropic/__init__.py |
Updated lazy loading to include Claude Agent exports |
python/packages/core/agent_framework/anthropic/__init__.pyi |
Added type stubs for Claude Agent exports |
python/samples/getting_started/agents/anthropic/*.py |
Seven sample files demonstrating Claude Agent usage patterns |
python/samples/getting_started/agents/anthropic/README.md |
Updated documentation with Claude Agent examples and environment variables |
python/packages/claude/LICENSE |
MIT license file for the package |
python/packages/claude/README.md |
Package readme with installation instructions |
Comments suppressed due to low confidence (1)
python/packages/claude/agent_framework_claude/_agent.py:219
- The type annotation should use
AgentMiddlewareTypesinstead ofMiddlewarefor consistency with other agent implementations in the codebase. Seepython/packages/github_copilot/agent_framework_github_copilot/_agent.py:148.
middleware: Sequence[Middleware] | None = None,
Motivation and Context
This PR adds
agent-framework-claudepackage that wraps the Claude Agent SDK to provide Claude agentic capabilities within the Agent Framework.Contribution Checklist