Skip to content

Remove Agents class#213

Merged
heyitsaamir merged 1 commit into
mainfrom
aamirj/removeAgents2
Nov 18, 2025
Merged

Remove Agents class#213
heyitsaamir merged 1 commit into
mainfrom
aamirj/removeAgents2

Conversation

@heyitsaamir

Copy link
Copy Markdown
Collaborator

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 Agent to ChatPrompt in your code to migrate.

Copilot AI review requested due to automatic review settings November 15, 2025 20:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 memory parameter to ChatPrompt.__init__() to enable stateful conversations
  • Modified ChatPrompt.send() to use constructor-provided memory as default when no explicit memory is passed
  • Removed the entire Agent class and its module
  • Updated all test applications to use ChatPrompt instead of Agent

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

Comment thread packages/ai/src/microsoft/teams/ai/chat_prompt.py
Comment thread packages/ai/src/microsoft/teams/ai/chat_prompt.py
@heyitsaamir
heyitsaamir merged commit af4cbed into main Nov 18, 2025
13 checks passed
@heyitsaamir
heyitsaamir deleted the aamirj/removeAgents2 branch November 18, 2025 00:59
This was referenced Nov 22, 2025
lilyydu added a commit that referenced this pull request Nov 22, 2025
## Release 2.0.0a6

### Changes

- Make images required for Thumbnail (#216)
- Revert "Add comment"
- Add comment
- Move tests to examples (#199)
- Bump glob from 11.0.3 to 11.1.0 in /tests/tab/Web (#215)
- Remove Agents class (#213)
- Add signin/failure invoke activity support (#206)
- Update config.yml (#214)
- Adds a github template when New issues are created  (#212)
- feat: add OAuth support for regional bots (#209)
- [feat] Add BotBuilder Plugin package, sample and tests (#190)

Co-authored-by: lilydu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants