A programming framework for agentic AI
Migrate remaining components (#4626)
Jack Gerrits218e84fd8e05
diff --git a/python/packages/autogen-agentchat/src/autogen_agentchat/agents/_assistant_agent.py b/python/packages/autogen-agentchat/src/autogen_agentchat/agents/_assistant_agent.pyindex 03684d3da..14037d8cd 100644--- a/python/packages/autogen-agentchat/src/autogen_agentchat/agents/_assistant_agent.py+++ b/python/packages/autogen-agentchat/src/autogen_agentchat/agents/_assistant_agent.py@@ -5,7 +5,6 @@ import warningsfrom typing import Any, AsyncGenerator, Awaitable, Callable, Dict, List, Mapping, Sequencefrom autogen_core import CancellationToken, FunctionCall-from autogen_core.components.tools import FunctionTool, Toolfrom autogen_core.models import (AssistantMessage,ChatCompletionClient,@@ -15,6 +14,7 @@ from autogen_core.models import (SystemMessage,UserMessage,)+from autogen_core.tools import FunctionTool, Toolfrom typing_extensions import deprecatedfrom .. import EVENT_LOGGER_NAMEdiff --git a/python/packages/autogen-agentchat/src/autogen_agentchat/agents/_tool_use_assistant_agent.py b/python/packages/autogen-agentchat/src/autogen_agentchat/agents/_tool_use_assistant_agent.pyindex 6142b63eb..1ebe1f226 100644--- a/python/packages/autogen-agentchat/src/autogen_agentchat/agents/_tool_use_assistant_agent.py+++ b/python/packages/autogen-agentchat/src/autogen_agentchat/agents/_tool_use_assistant_agent.py@@ -2,10 +2,10 @@ import loggingimport warningsfrom typing import Any, Awaitable, Callable, List-from autogen_core.components.tools import Toolfrom autogen_core.models import (ChatCompletionClient,)+from autogen_core.tools import Toolfrom .. import EVENT_LOGGER_NAMEfrom ._assistant_agent import AssistantAgentdiff --git a/python/packages/autogen-agentchat/src/autogen_agentchat/base/_handoff.py b/python/packages/autogen-agentchat/src/autogen_agentchat/base/_handoff.pyindex 3ab859a08..33efc5677 100644--- a/python/packages/autogen-agentchat/src/autogen_agentchat/base/_handoff.py+++ b/python/packages/autogen-agentchat/src/autogen_agentchat/base/_handoff.py@@ -1,7 +1,7 @@import loggingfrom typing import Any, Dict-from autogen_core.components.tools import FunctionTool, Tool+from autogen_core.tools import FunctionTool, Toolfrom pydantic import BaseModel, Field, model_validatorfrom .. import EVENT_LOGGER_NAMEdiff --git a/python/packages/autogen-agentchat/tests/test_assistant_agent.py b/python/packages/autogen-agentchat/tests/test_assistant_agent.pyindex c09a92a28..479f1c200 100644--- a/python/packages/autogen-agentchat/tests/test_assistant_agent.py+++ b/python/packages/autogen-agentchat/tests/test_assistant_agent.py@@ -15,7 +15,7 @@ from autogen_agentchat.messages import (ToolCallResultMessage,)from autogen_core import Image-from autogen_core.components.tools import FunctionTool+from autogen_core.tools import FunctionToolfrom autogen_ext.models import OpenAIChatCompletionClientfrom openai.resources.chat.completions import AsyncCompletionsfrom openai.types.chat.chat_completion import ChatCompletion, Choicediff --git a/python/packages/autogen-agentchat/tests/test_group_chat.py b/python/packages/autogen-agentchat/tests/test_group_chat.pyindex ca477962f..cf3ba0b20 100644--- a/python/packages/autogen-agentchat/tests/test_group_chat.py+++ b/python/packages/autogen-agentchat/tests/test_group_chat.py@@ -33,8 +33,8 @@ from autogen_agentchat.teams._group_chat._selector_group_chat import SelectorGrofrom autogen_agentchat.teams._group_chat._swarm_group_chat import SwarmGroupChatManagerfrom autogen_agentchat.ui import Consolefrom autogen_core import AgentId, CancellationToken, FunctionCall-from autogen_core.components.tools import FunctionToolfrom autogen_core.models import FunctionExecutionResult+from autogen_core.tools import FunctionToolfrom autogen_ext.code_executors.local import LocalCommandLineCodeExecutorfrom autogen_ext.models import OpenAIChatCompletionClient, ReplayChatCompletionClientfrom openai.resources.chat.completions import AsyncCompletionsdiff --git a/python/packages/autogen-core/docs/src/reference/index.md b/python/packages/autogen-core/docs/src/reference/index.mdindex 5e81a2cb1..6441e86ef 100644--- a/python/packages/autogen-core/docs/src/reference/index.md+++ b/python/packages/autogen-core/docs/src/reference/index.md@@ -29,8 +29,8 @@ python/autogen_corepython/autogen_core.code_executorpython/autogen_core.modelspython/autogen_core.model_context-python/autogen_core.components.tools-python/autogen_core.components.tool_agent+python/autogen_core.tools+python/autogen_core.tool_agentpython/autogen_core.exceptionspython/autogen_core.logging```diff --git a/python/packages/autogen-core/docs/src/reference/python/autogen_core.components.tool_agent.rst b/python/packages/autogen-core/docs/src/reference/python/autogen_core.tool_agent.rstsimilarity index 51%rename from python/packages/autogen-core/docs/src/reference/python/autogen_core.components.tool_agent.rstrename to python/packages/autogen-core/docs/src/reference/python/autogen_core.tool_agent.rstindex b18b93d8a..18e8e8a7d 100644--- a/python/packages/autogen-core/docs/src/reference/python/autogen_core.components.tool_agent.rst+++ b/python/packages/autogen-core/docs/src/reference/python/autogen_core.tool_agent.rst@@ -1,8 +1,8 @@-autogen\_core.components.tool\_agent+autogen\_core.tool\_agent====================================-.. automodule:: autogen_core.components.tool_agent+.. automodule:: autogen_core.tool_agent:members::undoc-members::show-inheritance:diff --git a/python/packages/autogen-core/docs/src/reference/python/autogen_core.components.tools.rst b/python/packages/autogen-core/docs/src/reference/python/autogen_core.tools.rstsimilarity index 53%rename from python/packages/autogen-core/docs/src/reference/python/autogen_core.components.tools.rstrename to python/packages/autogen-core/docs/src/reference/python/autogen_core.tools.rstindex 9895f97b5..d4cba2124 100644--- a/python/packages/autogen-core/docs/src/reference/python/autogen_core.components.tools.rst+++ b/python/packages/autogen-core/docs/src/reference/python/autogen_core.tools.rst@@ -1,8 +1,8 @@-autogen\_core.components.tools+autogen\_core.tools==============================-.. automodule:: autogen_core.components.tools+.. automodule:: autogen_core.tools:members::undoc-members::show-inheritance:diff --git a/python/packages/autogen-core/docs/src/user-guide/agentchat-user-guide/examples/company-research.ipynb b/python/packages/autogen-core/docs/src/user-guide/agentchat-user-guide/examples/company-research.ipynbindex 3cc8bcbee..8f4147b03 100644--- a/python/packages/autogen-core/docs/src/user-guide/agentchat-user-guide/examples/company-research.ipynb+++ b/python/packages/autogen-core/docs/src/user-guide/agentchat-user-guide/examples/company-research.ipynb@@ -25,7 +25,7 @@"from autogen_agentchat.agents import CodingAssistantAgent, ToolUseAssistantAgent\n","from autogen_agentchat.conditions import TextMentionTermination\n","from autogen_agentchat.teams import RoundRobinGroupChat\n",- "from autogen_core.components.tools import FunctionTool\n",+ "from autogen_core.tools import FunctionTool\n","from autogen_ext.models import OpenAIChatCompletionClient"]},diff --git a/python/packages/autogen-core/docs/src/user-guide/agentchat-user-guide/examples/literature-review.ipynb b/python/packages/autogen-core/docs/src/user-guide/agentchat-user-guide/examples/literature-review.ipynbindex e769a84b1..a224f26ef 100644--- a/python/packages/autogen-core/docs/src/user-guide/agentchat-user-guide/examples/literature-review.ipynb+++ b/python/packages/autogen-core/docs/src/user-guide/agentchat-user-guide/examples/literature-review.ipynb@@ -25,7 +25,7 @@"from autogen_agentchat.agents import CodingAssistantAgent, ToolUseAssistantAgent\n","from autogen_agentchat.conditions import TextMentionTermination\n","from autogen_agentchat.teams import RoundRobinGroupChat\n",- "from autogen_core.components.tools import FunctionTool\n",+ "from autogen_core.tools import FunctionTool\n","from autogen_ext.models import OpenAIChatCompletionClient"]},diff --git a/python/packages/autogen-core/docs/src/user-guide/core-user-guide/cookbook/tool-use-with-intervention.ipynb b/python/packages/autogen-core/docs/src/user-guide/core-user-guide/cookbook/tool-use-with-intervention.ipynbindex 9ef2f26d4..4a8d8d494 100644--- a/python/packages/autogen-core/docs/src/user-guide/core-user-guide/cookbook/tool-use-with-intervention.ipynb+++ b/python/packages/autogen-core/docs/src/user-guide/core-user-guide/cookbook/tool-use-with-intervention.ipynb@@ -29,7 +29,6 @@" message_handler,\n",")\n","from autogen_core.base.intervention import DefaultInterventionHandler, DropMessage\n",- "from autogen_core.components.tools import PythonCodeExecutionTool, ToolSchema\n","from autogen_core.models import (\n"," ChatCompletionClient,\n"," LLMMessage,\n",@@ -37,6 +36,7 @@" UserMessage,\n",")\n","from autogen_core.tool_agent import ToolAgent, ToolException, tool_agent_caller_loop\n",+ "from autogen_core.tools import PythonCodeExecutionTool, ToolSchema\n","from autogen_ext.code_executors.docker import DockerCommandLineCodeExecutor\n","from autogen_ext.models import OpenAIChatCompletionClient"]@@ -64,7 +64,7 @@"metadata": {},"source": ["Let's create a simple tool use agent that is capable of using tools through a\n",- "{py:class}`~autogen_core.components.tool_agent.ToolAgent`."+ "{py:class}`~autogen_core.tool_agent.ToolAgent`."]},{@@ -165,7 +165,7 @@"First, we create a Docker-based command-line code executor\n","using {py:class}`~autogen_ext.code_executors.docker.DockerCommandLineCodeExecutor`,\n","and then use it to instantiate a built-in Python code execution tool\n",- "{py:class}`~autogen_core.components.tools.PythonCodeExecutionTool`\n",+ "{py:class}`~autogen_core.tools.PythonCodeExecutionTool`\n","that runs code in a Docker container."]},diff --git a/python/packages/autogen-core/docs/src/user-guide/core-user-guide/design-patterns/group-chat.ipynb b/python/packages/autogen-core/docs/src/user-guide/core-user-guide/design-patterns/group-chat.ipynbindex a5e51d85a..6e8169881 100644--- a/python/packages/autogen-core/docs/src/user-guide/core-user-guide/design-patterns/group-chat.ipynb+++ b/python/packages/autogen-core/docs/src/user-guide/core-user-guide/design-patterns/group-chat.ipynb@@ -83,7 +83,6 @@" TypeSubscription,\n"," message_handler,\n",")\n",- "from autogen_core.components.tools import FunctionTool\n","from autogen_core.models import (\n"," AssistantMessage,\n"," ChatCompletionClient,\n",@@ -91,6 +90,7 @@" SystemMessage,\n"," UserMessage,\n",")\n",+ "from autogen_core.tools import FunctionTool\n","from autogen_ext.models import OpenAIChatCompletionClient\n","from IPython.display import display # type: ignore\n","from pydantic import BaseModel\n",@@ -233,7 +233,7 @@"\n","Now let's define the `IllustratorAgent` which uses a DALL-E model to generate\n","an illustration based on the description provided.\n",- "We set up the image generator as a tool using {py:class}`~autogen_core.components.tools.FunctionTool`\n",+ "We set up the image generator as a tool using {py:class}`~autogen_core.tools.FunctionTool`\n","wrapper, and use a model client to make the tool call."]},diff --git a/python/packages/autogen-core/docs/src/user-guide/core-user-guide/design-patterns/handoffs.ipynb b/python/packages/autogen-core/docs/src/user-guide/core-user-guide/design-patterns/handoffs.ipynbindex 6c86ed5d9..b40443cee 100644--- a/python/packages/autogen-core/docs/src/user-guide/core-user-guide/design-patterns/handoffs.ipynb+++ b/python/packages/autogen-core/docs/src/user-guide/core-user-guide/design-patterns/handoffs.ipynb@@ -65,7 +65,6 @@" TypeSubscription,\n"," message_handler,\n",")\n",- "from autogen_core.components.tools import FunctionTool, Tool\n","from autogen_core.models import (\n"," AssistantMessage,\n"," ChatCompletionClient,\n",@@ -75,6 +74,7 @@" SystemMessage,\n"," UserMessage,\n",")\n",+ "from autogen_core.tools import FunctionTool, Tool\n","from autogen_ext.models import OpenAIChatCompletionClient\n","from pydantic import BaseModel"]@@ -339,7 +339,7 @@"\n","The AI agents can use regular tools to complete tasks if they don't need to hand off the task to other agents.\n","We define the tools using simple functions and create the tools using the\n",- "{py:class}`~autogen_core.components.tools.FunctionTool` wrapper."+ "{py:class}`~autogen_core.tools.FunctionTool` wrapper."]},{diff --git a/python/packages/autogen-core/docs/src/user-guide/core-user-guide/framework/message-and-communication.ipynb b/python/packages/autogen-core/docs/src/user-guide/core-user-guide/framework/message-and-communication.ipynbindex a775c0f59..b9a8f423a 100644--- a/python/packages/autogen-core/docs/src/user-guide/core-user-guide/framework/message-and-communication.ipynb+++ b/python/packages/autogen-core/docs/src/user-guide/core-user-guide/framework/message-and-communication.ipynb@@ -368,7 +368,7 @@"recipient are tightly coupled -- they are created together and the sender\n","is linked to a specific instance of the recipient.\n","For example, an agent executes tool calls by sending direct messages to\n",- "an instance of {py:class}`~autogen_core.components.tool_agent.ToolAgent`,\n",+ "an instance of {py:class}`~autogen_core.tool_agent.ToolAgent`,\n","and uses the responses to form an action-observation loop."]},diff --git a/python/packages/autogen-core/docs/src/user-guide/core-user-guide/framework/tools.ipynb b/python/packages/autogen-core/docs/src/user-guide/core-user-guide/framework/tools.ipynbindex d8e318bd9..26f140302 100644--- a/python/packages/autogen-core/docs/src/user-guide/core-user-guide/framework/tools.ipynb+++ b/python/packages/autogen-core/docs/src/user-guide/core-user-guide/framework/tools.ipynb@@ -12,7 +12,7 @@"In the context of AI agents, tools are designed to be executed by agents in\n","response to model-generated function calls.\n","\n",- "AutoGen provides the {py:mod}`autogen_core.components.tools` module with a suite of built-in\n",+ "AutoGen provides the {py:mod}`autogen_core.tools` module with a suite of built-in\n","tools and utilities for creating and running custom tools."]},@@ -22,7 +22,7 @@"source": ["## Built-in Tools\n","\n",- "One of the built-in tools is the {py:class}`~autogen_core.components.tools.PythonCodeExecutionTool`,\n",+ "One of the built-in tools is the {py:class}`~autogen_core.tools.PythonCodeExecutionTool`,\n","which allows agents to execute Python code snippets.\n","\n","Here is how you create the tool and use it."@@ -44,7 +44,7 @@],"source": ["from autogen_core import CancellationToken\n",- "from autogen_core.components.tools import PythonCodeExecutionTool\n",+ "from autogen_core.tools import PythonCodeExecutionTool\n","from autogen_ext.code_executors.docker import DockerCommandLineCodeExecutor\n","\n","# Create the tool.\n",@@ -73,7 +73,7 @@"The {py:class}`~autogen_ext.code_executors.docker.DockerCommandLineCodeExecutor`\n","class is a built-in code executor that runs Python code snippets in a subprocess\n","in the command line environment of a docker container.\n",- "The {py:class}`~autogen_core.components.tools.PythonCodeExecutionTool` class wraps the code executor\n",+ "The {py:class}`~autogen_core.tools.PythonCodeExecutionTool` class wraps the code executor\n","and provides a simple interface to execute Python code snippets.\n","\n","Other built-in tools will be added in the future."@@ -87,9 +87,9 @@"\n","A tool can also be a simple Python function that performs a specific action.\n","To create a custom function tool, you just need to create a Python function\n",- "and use the {py:class}`~autogen_core.components.tools.FunctionTool` class to wrap it.\n",+ "and use the {py:class}`~autogen_core.tools.FunctionTool` class to wrap it.\n","\n",- "The {py:class}`~autogen_core.components.tools.FunctionTool` class uses descriptions and type annotations\n",+ "The {py:class}`~autogen_core.tools.FunctionTool` class uses descriptions and type annotations\n","to inform the LLM when and how to use a given function. The description provides context\n","about the function’s purpose and intended use cases, while type annotations inform the LLM about\n","the expected parameters and return type.\n",@@ -114,7 +114,7 @@"import random\n","\n","from autogen_core import CancellationToken\n",- "from autogen_core.components.tools import FunctionTool\n",+ "from autogen_core.tools import FunctionTool\n","from typing_extensions import Annotated\n","\n","\n",@@ -140,9 +140,9 @@"source": ["## Tool-Equipped Agent\n","\n",- "To use tools with an agent, you can use {py:class}`~autogen_core.components.tool_agent.ToolAgent`,\n",+ "To use tools with an agent, you can use {py:class}`~autogen_core.tool_agent.ToolAgent`,\n","by using it in a composition pattern.\n",- "Here is an example tool-use agent that uses {py:class}`~autogen_core.components.tool_agent.ToolAgent`\n",+ "Here is an example tool-use agent that uses {py:class}`~autogen_core.tool_agent.ToolAgent`\n","as an inner agent for executing tools."]},@@ -163,7 +163,6 @@" SingleThreadedAgentRuntime,\n"," message_handler,\n",")\n",- "from autogen_core.components.tools import FunctionTool, Tool, ToolSchema\n","from autogen_core.models import (\n"," ChatCompletionClient,\n"," LLMMessage,\n",@@ -171,6 +170,7 @@" UserMessage,\n",")\n","from autogen_core.tool_agent import ToolAgent, tool_agent_caller_loop\n",+ "from autogen_core.tools import FunctionTool, Tool, ToolSchema\n","from autogen_ext.models import OpenAIChatCompletionClient\n","\n","\n",@@ -209,7 +209,7 @@"cell_type": "markdown","metadata": {},"source": [- "The `ToolUseAgent` class uses a convenience function {py:meth}`~autogen_core.components.tool_agent.tool_agent_caller_loop`, \n",+ "The `ToolUseAgent` class uses a convenience function {py:meth}`~autogen_core.tool_agent.tool_agent_caller_loop`, \n","to handle the interaction between the model and the tool agent.\n","The core idea can be described using a simple control flow graph:\n","\n",@@ -218,7 +218,7 @@"The `ToolUseAgent`'s `handle_user_message` handler handles messages from the user,\n","and determines whether the model has generated a tool call.\n","If the model has generated tool calls, then the handler sends a function call\n",- "message to the {py:class}`~autogen_core.components.tool_agent.ToolAgent` agent\n",+ "message to the {py:class}`~autogen_core.tool_agent.ToolAgent` agent\n","to execute the tools,\n","and then queries the model again with the results of the tool calls.\n","This process continues until the model stops generating tool calls,\n",diff --git a/python/packages/autogen-core/samples/chess_game.py b/python/packages/autogen-core/samples/chess_game.pyindex b2a50f514..b359772aa 100644--- a/python/packages/autogen-core/samples/chess_game.py+++ b/python/packages/autogen-core/samples/chess_game.py@@ -15,9 +15,9 @@ from autogen_core import (DefaultTopicId,SingleThreadedAgentRuntime,)-from autogen_core.components.tools import FunctionToolfrom autogen_core.model_context import BufferedChatCompletionContextfrom autogen_core.models import SystemMessage+from autogen_core.tools import FunctionToolfrom chess import BLACK, SQUARE_NAMES, WHITE, Board, Movefrom chess import piece_name as get_piece_namefrom common.agents._chat_completion_agent import ChatCompletionAgentdiff --git a/python/packages/autogen-core/samples/common/agents/_chat_completion_agent.py b/python/packages/autogen-core/samples/common/agents/_chat_completion_agent.pyindex c0e50d9d2..246861cb6 100644--- a/python/packages/autogen-core/samples/common/agents/_chat_completion_agent.py+++ b/python/packages/autogen-core/samples/common/agents/_chat_completion_agent.py@@ -11,7 +11,6 @@ from autogen_core import (RoutedAgent,message_handler,)-from autogen_core.components.tools import Toolfrom autogen_core.model_context import ChatCompletionContextfrom autogen_core.models import (AssistantMessage,@@ -21,6 +20,7 @@ from autogen_core.models import (SystemMessage,UserMessage,)+from autogen_core.tools import Toolfrom ..types import (FunctionCallMessage,diff --git a/python/packages/autogen-core/samples/slow_human_in_loop.py b/python/packages/autogen-core/samples/slow_human_in_loop.pyindex df8530b1a..9c4476d06 100644--- a/python/packages/autogen-core/samples/slow_human_in_loop.py+++ b/python/packages/autogen-core/samples/slow_human_in_loop.py@@ -42,7 +42,6 @@ from autogen_core import (type_subscription,)from autogen_core.base.intervention import DefaultInterventionHandler-from autogen_core.components.tools import BaseToolfrom autogen_core.model_context import BufferedChatCompletionContextfrom autogen_core.models import (AssistantMessage,@@ -50,6 +49,7 @@ from autogen_core.models import (SystemMessage,UserMessage,)+from autogen_core.tools import BaseToolfrom common.types import TextMessagefrom common.utils import get_chat_completion_client_from_envsfrom pydantic import BaseModel, Fielddiff --git a/python/packages/autogen-core/src/autogen_core/components/tool_agent/__init__.py b/python/packages/autogen-core/src/autogen_core/components/tool_agent/__init__.pyindex e072efdd7..ff0313666 100644--- a/python/packages/autogen-core/src/autogen_core/components/tool_agent/__init__.py+++ b/python/packages/autogen-core/src/autogen_core/components/tool_agent/__init__.py@@ -1,11 +1,23 @@-from ._caller_loop import tool_agent_caller_loop-from ._tool_agent import (- InvalidToolArgumentsException,- ToolAgent,- ToolException,- ToolExecutionException,- ToolNotFoundException,+from typing import Any++from typing_extensions import deprecated++from ...tool_agent import (+ InvalidToolArgumentsException as InvalidToolArgumentsExceptionAlias,+)+from ...tool_agent import (+ ToolAgent as ToolAgentAlias,+)+from ...tool_agent import (+ ToolException as ToolExceptionAlias,+)+from ...tool_agent import (+ ToolExecutionException as ToolExecutionExceptionAlias,+)+from ...tool_agent import (+ ToolNotFoundException as ToolNotFoundExceptionAlias,)+from ...tool_agent import tool_agent_caller_loop as tool_agent_caller_loop_alias__all__ = ["ToolAgent",@@ -15,3 +27,45 @@ __all__ = ["ToolExecutionException","tool_agent_caller_loop",]+++@deprecated(+ "autogen_core.tool_agent.ToolAgentAlias moved to autogen_core.tool_agent.ToolAgentAlias. This alias will be removed in 0.4.0."+)+class ToolAgent(ToolAgentAlias):+ pass+++@deprecated(+ "autogen_core.tool_agent.ToolExceptionAlias moved to autogen_core.tool_agent.ToolExceptionAlias. This alias will be removed in 0.4.0."+)+class ToolException(ToolExceptionAlias):+ pass+++@deprecated(+ "autogen_core.tool_agent.ToolNotFoundExceptionAlias moved to autogen_core.tool_agent.ToolNotFoundExceptionAlias. This alias will be removed in 0.4.0."+)+class ToolNotFoundException(ToolNotFoundExceptionAlias):+ pass+++@deprecated(+ "autogen_core.tool_agent.InvalidToolArgumentsExceptionAlias moved to autogen_core.tool_agent.InvalidToolArgumentsExceptionAlias. This alias will be removed in 0.4.0."+)+class InvalidToolArgumentsException(InvalidToolArgumentsExceptionAlias):+ pass+++@deprecated(+ "autogen_core.tool_agent.ToolExecutionExceptionAlias moved to autogen_core.tool_agent.ToolExecutionExceptionAlias. This alias will be removed in 0.4.0."+)+class ToolExecutionException(ToolExecutionExceptionAlias):+ pass+++@deprecated(+ "autogen_core.tool_agent.tool_agent_caller_loop moved to autogen_core.tool_agent.tool_agent_caller_loop. This alias will be removed in 0.4.0."+)+def tool_agent_caller_loop(*args: Any, **kwargs: Any) -> Any:+ return tool_agent_caller_loop_alias(*args, **kwargs) # type: ignorediff --git a/python/packages/autogen-core/src/autogen_core/components/tools/__init__.py b/python/packages/autogen-core/src/autogen_core/components/tools/__init__.pyindex dcfb1759a..e3c480fee 100644--- a/python/packages/autogen-core/src/autogen_core/components/tools/__init__.py+++ b/python/packages/autogen-core/src/autogen_core/components/tools/__init__.py@@ -1,6 +1,33 @@-from ._base import BaseTool, BaseToolWithState, ParametersSchema, Tool, ToolSchema-from ._code_execution import CodeExecutionInput, CodeExecutionResult, PythonCodeExecutionTool-from ._function_tool import FunctionTool+from typing import TypeVar++from pydantic import BaseModel+from typing_extensions import deprecated++from ...tools import (+ BaseTool as BaseToolAlias,+)+from ...tools import (+ BaseToolWithState as BaseToolWithStateAlias,+)+from ...tools import (+ CodeExecutionInput as CodeExecutionInputAlias,+)+from ...tools import (+ CodeExecutionResult as CodeExecutionResultAlias,+)+from ...tools import FunctionTool as FunctionToolAlias+from ...tools import (+ ParametersSchema as ParametersSchemaAlias,+)+from ...tools import (+ PythonCodeExecutionTool as PythonCodeExecutionToolAlias,+)+from ...tools import (+ Tool as ToolAlias,+)+from ...tools import (+ ToolSchema as ToolSchemaAlias,+)__all__ = ["Tool",@@ -13,3 +40,69 @@ __all__ = ["CodeExecutionResult","FunctionTool",]+++ArgsT = TypeVar("ArgsT", bound=BaseModel, contravariant=True)+ReturnT = TypeVar("ReturnT", bound=BaseModel, covariant=True)+StateT = TypeVar("StateT", bound=BaseModel)+++@deprecated(+ "autogen_core.tools.BaseToolAlias moved to autogen_core.tools.BaseToolAlias. This alias will be removed in 0.4.0."+)+class BaseTool(BaseToolAlias[ArgsT, ReturnT]):+ pass+++@deprecated("autogen_core.tools.ToolAlias moved to autogen_core.tools.ToolAlias. This alias will be removed in 0.4.0.")+class Tool(ToolAlias):+ pass+++@deprecated(+ "autogen_core.tools.ToolSchemaAlias moved to autogen_core.tools.ToolSchemaAlias. This alias will be removed in 0.4.0."+)+class ToolSchema(ToolSchemaAlias):+ pass+++@deprecated(+ "autogen_core.tools.ParametersSchemaAlias moved to autogen_core.tools.ParametersSchemaAlias. This alias will be removed in 0.4.0."+)+class ParametersSchema(ParametersSchemaAlias):+ pass+++@deprecated(+ "autogen_core.tools.BaseToolWithStateAlias moved to autogen_core.tools.BaseToolWithStateAlias. This alias will be removed in 0.4.0."+)+class BaseToolWithState(BaseToolWithStateAlias[ArgsT, ReturnT, StateT]):+ pass+++@deprecated(+ "autogen_core.tools.PythonCodeExecutionToolAlias moved to autogen_core.tools.PythonCodeExecutionToolAlias. This alias will be removed in 0.4.0."+)+class PythonCodeExecutionTool(PythonCodeExecutionToolAlias):+ pass+++@deprecated(+ "autogen_core.tools.CodeExecutionInputAlias moved to autogen_core.tools.CodeExecutionInputAlias. This alias will be removed in 0.4.0."+)+class CodeExecutionInput(CodeExecutionInputAlias):+ pass+++@deprecated(+ "autogen_core.tools.CodeExecutionResultAlias moved to autogen_core.tools.CodeExecutionResultAlias. This alias will be removed in 0.4.0."+)+class CodeExecutionResult(CodeExecutionResultAlias):+ pass+++@deprecated(+ "autogen_core.tools.FunctionToolAlias moved to autogen_core.tools.FunctionToolAlias. This alias will be removed in 0.4.0."+)+class FunctionTool(FunctionToolAlias):+ passdiff --git a/python/packages/autogen-core/src/autogen_core/models/_model_client.py b/python/packages/autogen-core/src/autogen_core/models/_model_client.pyindex fef42da5d..c141c480d 100644--- a/python/packages/autogen-core/src/autogen_core/models/_model_client.py+++ b/python/packages/autogen-core/src/autogen_core/models/_model_client.py@@ -12,7 +12,7 @@ from typing_extensions import ()from .. import CancellationToken-from ..components.tools import Tool, ToolSchema+from ..tools import Tool, ToolSchemafrom ._types import CreateResult, LLMMessage, RequestUsagediff --git a/python/packages/autogen-core/src/autogen_core/tool_agent/__init__.py b/python/packages/autogen-core/src/autogen_core/tool_agent/__init__.pynew file mode 100644index 000000000..e072efdd7--- /dev/null+++ b/python/packages/autogen-core/src/autogen_core/tool_agent/__init__.py@@ -0,0 +1,17 @@+from ._caller_loop import tool_agent_caller_loop+from ._tool_agent import (+ InvalidToolArgumentsException,+ ToolAgent,+ ToolException,+ ToolExecutionException,+ ToolNotFoundException,+)++__all__ = [+ "ToolAgent",+ "ToolException",+ "ToolNotFoundException",+ "InvalidToolArgumentsException",+ "ToolExecutionException",+ "tool_agent_caller_loop",+]diff --git a/python/packages/autogen-core/src/autogen_core/components/tool_agent/_caller_loop.py b/python/packages/autogen-core/src/autogen_core/tool_agent/_caller_loop.pysimilarity index 96%rename from python/packages/autogen-core/src/autogen_core/components/tool_agent/_caller_loop.pyrename to python/packages/autogen-core/src/autogen_core/tool_agent/_caller_loop.pyindex 9a26fe015..2353ca184 100644--- a/python/packages/autogen-core/src/autogen_core/components/tool_agent/_caller_loop.py+++ b/python/packages/autogen-core/src/autogen_core/tool_agent/_caller_loop.py@@ -1,8 +1,8 @@import asynciofrom typing import List-from ... import AgentId, AgentRuntime, BaseAgent, CancellationToken, FunctionCall-from ...models import (+from .. import AgentId, AgentRuntime, BaseAgent, CancellationToken, FunctionCall+from ..models import (AssistantMessage,ChatCompletionClient,FunctionExecutionResult,diff --git a/python/packages/autogen-core/src/autogen_core/components/tool_agent/_tool_agent.py b/python/packages/autogen-core/src/autogen_core/tool_agent/_tool_agent.pysimilarity index 95%rename from python/packages/autogen-core/src/autogen_core/components/tool_agent/_tool_agent.pyrename to python/packages/autogen-core/src/autogen_core/tool_agent/_tool_agent.pyindex a2e5b9ca0..08d8f4b25 100644--- a/python/packages/autogen-core/src/autogen_core/components/tool_agent/_tool_agent.py+++ b/python/packages/autogen-core/src/autogen_core/tool_agent/_tool_agent.py@@ -2,8 +2,8 @@ import jsonfrom dataclasses import dataclassfrom typing import List-from ... import FunctionCall, MessageContext, RoutedAgent, message_handler-from ...models import FunctionExecutionResult+from .. import FunctionCall, MessageContext, RoutedAgent, message_handler+from ..models import FunctionExecutionResultfrom ..tools import Tool__all__ = [diff --git a/python/packages/autogen-core/src/autogen_core/tools/__init__.py b/python/packages/autogen-core/src/autogen_core/tools/__init__.pynew file mode 100644index 000000000..dcfb1759a--- /dev/null+++ b/python/packages/autogen-core/src/autogen_core/tools/__init__.py@@ -0,0 +1,15 @@+from ._base import BaseTool, BaseToolWithState, ParametersSchema, Tool, ToolSchema+from ._code_execution import CodeExecutionInput, CodeExecutionResult, PythonCodeExecutionTool+from ._function_tool import FunctionTool++__all__ = [+ "Tool",+ "ToolSchema",+ "ParametersSchema",+ "BaseTool",+ "BaseToolWithState",+ "PythonCodeExecutionTool",+ "CodeExecutionInput",+ "CodeExecutionResult",+ "FunctionTool",+]diff --git a/python/packages/autogen-core/src/autogen_core/components/tools/_base.py b/python/packages/autogen-core/src/autogen_core/tools/_base.pysimilarity index 98%rename from python/packages/autogen-core/src/autogen_core/components/tools/_base.pyrename to python/packages/autogen-core/src/autogen_core/tools/_base.pyindex b41d747d6..7c4042e9a 100644--- a/python/packages/autogen-core/src/autogen_core/components/tools/_base.py+++ b/python/packages/autogen-core/src/autogen_core/tools/_base.py@@ -7,8 +7,8 @@ import jsonreffrom pydantic import BaseModelfrom typing_extensions import NotRequired-from ... import CancellationToken-from ..._function_utils import normalize_annotated_type+from .. import CancellationToken+from .._function_utils import normalize_annotated_typeT = TypeVar("T", bound=BaseModel, contravariant=True)diff --git a/python/packages/autogen-core/src/autogen_core/components/tools/_code_execution.py b/python/packages/autogen-core/src/autogen_core/tools/_code_execution.pysimilarity index 92%rename from python/packages/autogen-core/src/autogen_core/components/tools/_code_execution.pyrename to python/packages/autogen-core/src/autogen_core/tools/_code_execution.pyindex eb792a32f..f3f2b072e 100644--- a/python/packages/autogen-core/src/autogen_core/components/tools/_code_execution.py+++ b/python/packages/autogen-core/src/autogen_core/tools/_code_execution.py@@ -1,7 +1,7 @@from pydantic import BaseModel, Field, model_serializer-from ... import CancellationToken-from ...code_executor import CodeBlock, CodeExecutor+from .. import CancellationToken+from ..code_executor import CodeBlock, CodeExecutorfrom ._base import BaseTooldiff --git a/python/packages/autogen-core/src/autogen_core/components/tools/_function_tool.py b/python/packages/autogen-core/src/autogen_core/tools/_function_tool.pysimilarity index 96%rename from python/packages/autogen-core/src/autogen_core/components/tools/_function_tool.pyrename to python/packages/autogen-core/src/autogen_core/tools/_function_tool.pyindex 45041121c..026fc845e 100644--- a/python/packages/autogen-core/src/autogen_core/components/tools/_function_tool.py+++ b/python/packages/autogen-core/src/autogen_core/tools/_function_tool.py@@ -4,8 +4,8 @@ from typing import Any, Callablefrom pydantic import BaseModel-from ... import CancellationToken-from ..._function_utils import (+from .. import CancellationToken+from .._function_utils import (args_base_model_from_signature,get_typed_signature,)@@ -39,7 +39,7 @@ class FunctionTool(BaseTool[BaseModel, BaseModel]):import randomfrom autogen_core import CancellationToken- from autogen_core.components.tools import FunctionTool+ from autogen_core.tools import FunctionToolfrom typing_extensions import Annotatedimport asynciodiff --git a/python/packages/autogen-core/tests/test_tool_agent.py b/python/packages/autogen-core/tests/test_tool_agent.pyindex f17ce6424..d0d6dec89 100644--- a/python/packages/autogen-core/tests/test_tool_agent.py+++ b/python/packages/autogen-core/tests/test_tool_agent.py@@ -4,14 +4,6 @@ from typing import Any, AsyncGenerator, List, Mapping, Optional, Sequence, Unionimport pytestfrom autogen_core import AgentId, CancellationToken, FunctionCall, SingleThreadedAgentRuntime-from autogen_core.components.tool_agent import (- InvalidToolArgumentsException,- ToolAgent,- ToolExecutionException,- ToolNotFoundException,- tool_agent_caller_loop,-)-from autogen_core.components.tools import FunctionTool, Tool, ToolSchemafrom autogen_core.models import (AssistantMessage,ChatCompletionClient,@@ -23,6 +15,14 @@ from autogen_core.models import (RequestUsage,UserMessage,)+from autogen_core.tool_agent import (+ InvalidToolArgumentsException,+ ToolAgent,+ ToolExecutionException,+ ToolNotFoundException,+ tool_agent_caller_loop,+)+from autogen_core.tools import FunctionTool, Tool, ToolSchemadef _pass_function(input: str) -> str:diff --git a/python/packages/autogen-core/tests/test_tools.py b/python/packages/autogen-core/tests/test_tools.pyindex b35986423..64d97e115 100644--- a/python/packages/autogen-core/tests/test_tools.py+++ b/python/packages/autogen-core/tests/test_tools.py@@ -4,8 +4,8 @@ from typing import Annotated, Listimport pytestfrom autogen_core import CancellationTokenfrom autogen_core._function_utils import get_typed_signature-from autogen_core.components.tools import BaseTool, FunctionTool-from autogen_core.components.tools._base import ToolSchema+from autogen_core.tools import BaseTool, FunctionTool+from autogen_core.tools._base import ToolSchemafrom pydantic import BaseModel, Field, model_serializerfrom pydantic_core import PydanticUndefineddiff --git a/python/packages/autogen-ext/src/autogen_ext/agents/file_surfer/_tool_definitions.py b/python/packages/autogen-ext/src/autogen_ext/agents/file_surfer/_tool_definitions.pyindex b4c8ad901..462061d14 100644--- a/python/packages/autogen-ext/src/autogen_ext/agents/file_surfer/_tool_definitions.py+++ b/python/packages/autogen-ext/src/autogen_ext/agents/file_surfer/_tool_definitions.py@@ -1,4 +1,4 @@-from autogen_core.components.tools import ParametersSchema, ToolSchema+from autogen_core.tools import ParametersSchema, ToolSchemaTOOL_OPEN_PATH = ToolSchema(name="open_path",diff --git a/python/packages/autogen-ext/src/autogen_ext/agents/openai/_openai_assistant_agent.py b/python/packages/autogen-ext/src/autogen_ext/agents/openai/_openai_assistant_agent.pyindex 8a4b31975..4e16d7001 100644--- a/python/packages/autogen-ext/src/autogen_ext/agents/openai/_openai_assistant_agent.py+++ b/python/packages/autogen-ext/src/autogen_ext/agents/openai/_openai_assistant_agent.py@@ -33,8 +33,8 @@ from autogen_agentchat.messages import (ToolCallResultMessage,)from autogen_core import CancellationToken, FunctionCall-from autogen_core.components.tools import FunctionTool, Toolfrom autogen_core.models._types import FunctionExecutionResult+from autogen_core.tools import FunctionTool, Tool_has_openai_dependencies: bool = Truetry:diff --git a/python/packages/autogen-ext/src/autogen_ext/agents/video_surfer/_video_surfer.py b/python/packages/autogen-ext/src/autogen_ext/agents/video_surfer/_video_surfer.pyindex d74161df1..21146c3c7 100644--- a/python/packages/autogen-ext/src/autogen_ext/agents/video_surfer/_video_surfer.py+++ b/python/packages/autogen-ext/src/autogen_ext/agents/video_surfer/_video_surfer.py@@ -1,8 +1,8 @@from typing import Any, Awaitable, Callable, List, Optionalfrom autogen_agentchat.agents import AssistantAgent-from autogen_core.components.tools import Toolfrom autogen_core.models import ChatCompletionClient+from autogen_core.tools import Toolfrom .tools import (extract_audio,diff --git a/python/packages/autogen-ext/src/autogen_ext/agents/web_surfer/_tool_definitions.py b/python/packages/autogen-ext/src/autogen_ext/agents/web_surfer/_tool_definitions.pyindex 5d54d5ff1..fd2928248 100644--- a/python/packages/autogen-ext/src/autogen_ext/agents/web_surfer/_tool_definitions.py+++ b/python/packages/autogen-ext/src/autogen_ext/agents/web_surfer/_tool_definitions.py@@ -1,6 +1,6 @@from typing import Any, Dict-from autogen_core.components.tools._base import ParametersSchema, ToolSchema+from autogen_core.tools._base import ParametersSchema, ToolSchemadef _load_tool(tooldef: Dict[str, Any]) -> ToolSchema:diff --git a/python/packages/autogen-ext/src/autogen_ext/models/_openai/_openai_client.py b/python/packages/autogen-ext/src/autogen_ext/models/_openai/_openai_client.pyindex 154c0a68b..56bd96708 100644--- a/python/packages/autogen-ext/src/autogen_ext/models/_openai/_openai_client.py+++ b/python/packages/autogen-ext/src/autogen_ext/models/_openai/_openai_client.py@@ -28,7 +28,6 @@ from autogen_core import (FunctionCall,Image,)-from autogen_core.components.tools import Tool, ToolSchemafrom autogen_core.logging import LLMCallEventfrom autogen_core.models import (AssistantMessage,@@ -43,6 +42,7 @@ from autogen_core.models import (TopLogprob,UserMessage,)+from autogen_core.tools import Tool, ToolSchemafrom openai import AsyncAzureOpenAI, AsyncOpenAIfrom openai.types.chat import (ChatCompletion,diff --git a/python/packages/autogen-ext/src/autogen_ext/models/_reply_chat_completion_client.py b/python/packages/autogen-ext/src/autogen_ext/models/_reply_chat_completion_client.pyindex 42f9e89e2..e3e0ff35a 100644--- a/python/packages/autogen-ext/src/autogen_ext/models/_reply_chat_completion_client.py+++ b/python/packages/autogen-ext/src/autogen_ext/models/_reply_chat_completion_client.py@@ -4,7 +4,6 @@ import loggingfrom typing import Any, AsyncGenerator, List, Mapping, Optional, Sequence, Unionfrom autogen_core import EVENT_LOGGER_NAME, CancellationToken-from autogen_core.components.tools import Tool, ToolSchemafrom autogen_core.models import (ChatCompletionClient,CreateResult,@@ -12,6 +11,7 @@ from autogen_core.models import (ModelCapabilities,RequestUsage,)+from autogen_core.tools import Tool, ToolSchemalogger = logging.getLogger(EVENT_LOGGER_NAME)diff --git a/python/packages/autogen-ext/src/autogen_ext/tools/_langchain_adapter.py b/python/packages/autogen-ext/src/autogen_ext/tools/_langchain_adapter.pyindex cb6e82aa8..ea657691d 100644--- a/python/packages/autogen-ext/src/autogen_ext/tools/_langchain_adapter.py+++ b/python/packages/autogen-ext/src/autogen_ext/tools/_langchain_adapter.py@@ -5,7 +5,7 @@ import inspectfrom typing import TYPE_CHECKING, Any, Callable, Dict, Type, castfrom autogen_core import CancellationToken-from autogen_core.components.tools import BaseTool+from autogen_core.tools import BaseToolfrom pydantic import BaseModel, Field, create_modelif TYPE_CHECKING:diff --git a/python/packages/autogen-ext/tests/models/test_openai_model_client.py b/python/packages/autogen-ext/tests/models/test_openai_model_client.pyindex 8cf302450..76b481aa2 100644--- a/python/packages/autogen-ext/tests/models/test_openai_model_client.py+++ b/python/packages/autogen-ext/tests/models/test_openai_model_client.py@@ -4,7 +4,6 @@ from unittest.mock import MagicMockimport pytestfrom autogen_core import CancellationToken, Image-from autogen_core.components.tools import BaseTool, FunctionToolfrom autogen_core.models import (AssistantMessage,CreateResult,@@ -15,6 +14,7 @@ from autogen_core.models import (SystemMessage,UserMessage,)+from autogen_core.tools import BaseTool, FunctionToolfrom autogen_ext.models import AzureOpenAIChatCompletionClient, OpenAIChatCompletionClientfrom autogen_ext.models._openai._model_info import resolve_modelfrom autogen_ext.models._openai._openai_client import calculate_vision_tokens, convert_toolsdiff --git a/python/packages/autogen-ext/tests/test_openai_assistant_agent.py b/python/packages/autogen-ext/tests/test_openai_assistant_agent.pyindex 0166f17db..da55d860c 100644--- a/python/packages/autogen-ext/tests/test_openai_assistant_agent.py+++ b/python/packages/autogen-ext/tests/test_openai_assistant_agent.py@@ -5,7 +5,7 @@ from typing import List, Literal, Optional, Unionimport pytestfrom autogen_agentchat.messages import TextMessagefrom autogen_core import CancellationToken-from autogen_core.components.tools._base import BaseTool, Tool+from autogen_core.tools._base import BaseTool, Toolfrom autogen_ext.agents.openai import OpenAIAssistantAgentfrom azure.identity import DefaultAzureCredential, get_bearer_token_providerfrom openai import AsyncAzureOpenAIdiff --git a/python/packages/autogen-magentic-one/src/autogen_magentic_one/agents/file_surfer/_tools.py b/python/packages/autogen-magentic-one/src/autogen_magentic_one/agents/file_surfer/_tools.pyindex 740ea1c73..a49c2d8b7 100644--- a/python/packages/autogen-magentic-one/src/autogen_magentic_one/agents/file_surfer/_tools.py+++ b/python/packages/autogen-magentic-one/src/autogen_magentic_one/agents/file_surfer/_tools.py@@ -1,4 +1,4 @@-from autogen_core.components.tools import ParametersSchema, ToolSchema+from autogen_core.tools import ParametersSchema, ToolSchemaTOOL_OPEN_LOCAL_FILE = ToolSchema(name="open_local_file",diff --git a/python/packages/autogen-magentic-one/src/autogen_magentic_one/agents/multimodal_web_surfer/tool_definitions.py b/python/packages/autogen-magentic-one/src/autogen_magentic_one/agents/multimodal_web_surfer/tool_definitions.pyindex b662f4101..06832e989 100644--- a/python/packages/autogen-magentic-one/src/autogen_magentic_one/agents/multimodal_web_surfer/tool_definitions.py+++ b/python/packages/autogen-magentic-one/src/autogen_magentic_one/agents/multimodal_web_surfer/tool_definitions.py@@ -1,7 +1,7 @@from typing import Any, Dict-# TODO Why does pylance fail if I import from autogen_core.components.tools instead?-from autogen_core.components.tools._base import ParametersSchema, ToolSchema+# TODO Why does pylance fail if I import from autogen_core.tools instead?+from autogen_core.tools._base import ParametersSchema, ToolSchemadef _load_tool(tooldef: Dict[str, Any]) -> ToolSchema:diff --git a/python/packages/autogen-magentic-one/tests/headless_web_surfer/test_web_surfer.py b/python/packages/autogen-magentic-one/tests/headless_web_surfer/test_web_surfer.pyindex 2afe77579..b9a7d4cee 100644--- a/python/packages/autogen-magentic-one/tests/headless_web_surfer/test_web_surfer.py+++ b/python/packages/autogen-magentic-one/tests/headless_web_surfer/test_web_surfer.py@@ -9,10 +9,10 @@ from typing import Mappingimport pytestfrom autogen_core import AgentId, AgentProxy, FunctionCall, SingleThreadedAgentRuntime-from autogen_core.components.tools._base import ToolSchemafrom autogen_core.models import (UserMessage,)+from autogen_core.tools._base import ToolSchemafrom autogen_magentic_one.agents.multimodal_web_surfer import MultimodalWebSurferfrom autogen_magentic_one.agents.multimodal_web_surfer.tool_definitions import (TOOL_PAGE_DOWN,diff --git a/python/packages/autogen-studio/autogenstudio/database/component_factory.py b/python/packages/autogen-studio/autogenstudio/database/component_factory.pyindex 3b9082554..140112ede 100644--- a/python/packages/autogen-studio/autogenstudio/database/component_factory.py+++ b/python/packages/autogen-studio/autogenstudio/database/component_factory.py@@ -9,7 +9,7 @@ import yamlfrom autogen_agentchat.agents import AssistantAgent, UserProxyAgentfrom autogen_agentchat.conditions import MaxMessageTermination, StopMessageTermination, TextMentionTerminationfrom autogen_agentchat.teams import MagenticOneGroupChat, RoundRobinGroupChat, SelectorGroupChat-from autogen_core.components.tools import FunctionTool+from autogen_core.tools import FunctionToolfrom autogen_ext.agents.file_surfer import FileSurferfrom autogen_ext.agents.magentic_one import MagenticOneCoderAgentfrom autogen_ext.agents.web_surfer import MultimodalWebSurferdiff --git a/python/packages/autogen-studio/tests/test_component_factory.py b/python/packages/autogen-studio/tests/test_component_factory.pyindex 8d2b8cbb8..57c0e3819 100644--- a/python/packages/autogen-studio/tests/test_component_factory.py+++ b/python/packages/autogen-studio/tests/test_component_factory.py@@ -4,7 +4,7 @@ from typing import Listfrom autogen_agentchat.agents import AssistantAgentfrom autogen_agentchat.teams import RoundRobinGroupChat, SelectorGroupChat, MagenticOneGroupChatfrom autogen_agentchat.conditions import MaxMessageTermination, StopMessageTermination, TextMentionTermination-from autogen_core.components.tools import FunctionTool+from autogen_core.tools import FunctionToolfrom autogenstudio.datamodel.types import (AgentConfig,