-
Notifications
You must be signed in to change notification settings - Fork 6
Remove Agents class #213
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?
Remove Agents class #213
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 removes the experimental Agent class and consolidates its functionality into ChatPrompt by adding an optional memory parameter to the ChatPrompt constructor. This change aligns the Python SDK with other language implementations and reduces API surface area.
Key changes:
- Added optional
memoryparameter toChatPrompt.__init__()to enable stateful conversations - Modified
ChatPrompt.send()to use constructor-provided memory as default when no explicit memory is passed - Removed the entire
Agentclass and its module - Updated all test applications to use
ChatPromptinstead ofAgent
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/ai/src/microsoft/teams/ai/chat_prompt.py | Added memory parameter to constructor and updated send() to use it as fallback |
| packages/ai/src/microsoft/teams/ai/agent.py | Deleted the entire Agent class implementation |
| packages/ai/src/microsoft/teams/ai/init.py | Removed Agent from exports |
| tests/mcp-client/src/main.py | Replaced Agent with ChatPrompt, updated variable names and comments |
| tests/mcp-client/README.md | Updated documentation to reference ChatPrompt instead of Agent |
| tests/ai-test/src/main.py | Replaced Agent with ChatPrompt in multiple handlers |
| tests/ai-test/src/handlers/memory_management.py | Replaced Agent with ChatPrompt in stateful conversation handler |
| tests/ai-test/src/handlers/function_calling.py | Replaced Agent with ChatPrompt in function calling examples |
| tests/ai-test/README.md | Updated documentation to remove Agent reference |
| self, | ||
| model: AIModel, | ||
| *, | ||
| memory: Memory | None = None, |
Copilot
AI
Nov 15, 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.
The new memory parameter in the ChatPrompt constructor lacks test coverage. While the existing tests verify memory functionality when passed to send(), there are no tests verifying that memory set in the constructor is properly used as a default. Consider adding a test that creates a ChatPrompt with memory in the constructor and verifies it's used across multiple send() calls without explicitly passing memory each time.
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.
@copilot can you make sure we test the case with a memory in constructor at least once?
We had this experimental class called Agents that was basically a "stateful" ChatPrompt. To align with other languages, this class doesn't add much value, and is taking on additional support pressure. So I'm going to remove it in interest of just ChatPrompt.
ChatPrompt now supports "memory" so if you give it memory when you construct it, it'll use that memory instance for subsequent calls (which is basically what Agent did).
So TLDR: Change
AgenttoChatPromptin your code to migrate.