Change8

Migrating to AutoGen python-v0.5.1

Version python-v0.5.1 introduces 2 breaking changes. This guide details how to update your code.

Released: 4/3/2025

2
Breaking Changes
3
Migration Steps
12
Affected Symbols

⚠️ Check Your Code

If you use any of these symbols, you need to read this guide:

AgentEventChatMessageBaseAgentEventBaseChatMessageBaseChatAgentTerminationConditionStructuredMessageAssistantAgentOpenAIChatCompletionClientAzureAISearchToolSelectorGroupChatCodeExecutor

Breaking Changes

Issue #1

Type hint changes for AgentChat message types: Custom agents or termination conditions must now use BaseChatMessage and BaseAgentEvent instead of the previous union types.

Issue #2

Code Executors now use a temporary directory as the default directory instead of the previous default.

Migration Steps

  1. 1
    If subclassing BaseChatAgent, update 'on_messages', 'on_messages_stream', 'run', and 'run_stream' method signatures to use BaseChatMessage and BaseAgentEvent.
  2. 2
    If subclassing TerminationCondition, update the signature to use BaseChatMessage and BaseAgentEvent.
  3. 3
    If relying on the default working directory of Code Executors, explicitly set a directory path as it now defaults to a temporary one.

Release Summary

This release introduces structured output support for agents and model clients, refactors AgentChat message types into a class hierarchy for better extensibility, and adds a new Azure AI Search tool.

Need More Details?

View the full release notes and all changes for AutoGen python-v0.5.1.

View Full Changelog