Migrate from ToolRegistry AutoGen methods to AutoGenAdapter for cleaner architecture
python
from praisonaiagents import Agent
agent = Agent(name="migration-agent", instructions="Migrate tools from autogen to the registry.")
agent.start("Migrate my autogen tool definitions to the PraisonAI tool registry.")
AutoGen integration now lives in AutoGenAdapter — the old ToolRegistry autogen methods were removed in PR #2248.
python
from praisonai import PraisonAI
# AutoGenAdapter is wired automatically when framework is autogen-family
praison = PraisonAI(agent_file="agents.yaml", framework="autogen")
praison.run()
The user migrates legacy AutoGen ToolRegistry wiring; new integrations use AutoGenAdapter while removed registry methods are replaced.
Diagram
Quick Start
Migrate from the removed ToolRegistry AutoGen methods to AutoGenAdapter.
from praisonai.framework_adapters import AutoGenAdapter
from praisonai.tool_registry import ToolRegistry
def search_tool(query: str) -> str:
return f"Found results for: {query}"
# Use AutoGenAdapter for AutoGen-specific features
adapter = AutoGenAdapter()
# Use ToolRegistry for general tool registration
registry = ToolRegistry()
registry.register_function("search", search_tool)
How It Works
The migration involves moving from ToolRegistry AutoGen methods to the dedicated AutoGenAdapter class.
Diagram
sequenceDiagram
participant User
participant ToolRegistry
participant AutoGenAdapter
participant AutoGen
User->>ToolRegistry: register_autogen_adapter() ❌ removed
Note over User,AutoGen: Do not use — raises AttributeError
User->>AutoGenAdapter: Use AutoGenAdapter
AutoGenAdapter->>AutoGen: Direct integration
AutoGen-->>User: Tool registered
Note over User,AutoGen: Recommended path for new code
classDef legacy fill:#F59E0B,stroke:#7C90A0,color:#fff
classDef new fill:#10B981,stroke:#7C90A0,color:#fff
class ToolRegistry legacy
class AutoGenAdapter new
Configuration Options
Both approaches support the same configuration patterns for AutoGen tool integration.
Option
Type
Default
Description
tool_name
str
Required
Name identifier for the tool
adapter_function
Callable
Required
Tool implementation function
registry_instance
ToolRegistry
None
Optional registry instance
builtin_adapters
bool
False
Whether to include builtin adapters
What Changed
Method
Status
Replacement
register_autogen_adapter(tool_type_name, adapter)
Removed (PR #2248)
Use AutoGenAdapter from praisonai.framework_adapters
get_autogen_adapter(tool_type_name)
Removed (PR #2248)
Use AutoGenAdapter from praisonai.framework_adapters
list_autogen_adapters()
Removed (PR #2248)
Use AutoGenAdapter from praisonai.framework_adapters
register_builtin_autogen_adapters()
Removed (PR #2248)
Use AutoGenAdapter from praisonai.framework_adapters
create_autogen_tool_function(tool_class) and the 17 `autogen_
wrappers on praisonai.inbuilt_tools.autogen_tools | Removed (PR #3583) | No replacement needed — the sole consumer (ToolRegistry.register_builtin_autogen_adapters()) was removed in PR #1590. Use AutoGenAdapter from praisonai.framework_adapters. The module itself remains as a praisonai_tools presence-probe host — retained only for the release from praisonai.inbuilt_tools import * smoke test. It no longer backs PRAISONAI_TOOLS_AVAILABLE` (PR #5318). |