diff --git a/autogen/agentchat/__init__.py b/autogen/agentchat/__init__.py index 6c3c12e6ce..30770fe5f8 100644 --- a/autogen/agentchat/__init__.py +++ b/autogen/agentchat/__init__.py @@ -7,6 +7,11 @@ from .agent import Agent from .assistant_agent import AssistantAgent from .chat import ChatResult, initiate_chats +from .contrib.reasoning_agent import ( + ReasoningAgent, + ThinkNode, + visualize_tree, +) # Imported last to avoid circular imports from .contrib.swarm_agent import ( @@ -39,4 +44,7 @@ "ON_CONDITION", "AFTER_WORK", "AfterWorkOption", + "ReasoningAgent", + "visualize_tree", + "ThinkNode", ] diff --git a/notebook/agentchat_reasoning_agent.ipynb b/notebook/agentchat_reasoning_agent.ipynb index 7026be6080..e5ab615742 100644 --- a/notebook/agentchat_reasoning_agent.ipynb +++ b/notebook/agentchat_reasoning_agent.ipynb @@ -51,12 +51,11 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ - "from autogen import AssistantAgent, UserProxyAgent\n", - "from autogen.agentchat.contrib.reasoning_agent import ReasoningAgent, ThinkNode, visualize_tree\n", + "from autogen import AssistantAgent, ReasoningAgent, ThinkNode, UserProxyAgent, visualize_tree\n", "\n", "reason_agent = ReasoningAgent(\n", " name=\"reason_agent\",\n", @@ -2764,7 +2763,7 @@ ] }, "kernelspec": { - "display_name": "venv", + "display_name": "base", "language": "python", "name": "python3" }, diff --git a/website/blog/2024-12-02-ReasoningAgent2/index.mdx b/website/blog/2024-12-02-ReasoningAgent2/index.mdx index d7f859d82b..d194c3f365 100644 --- a/website/blog/2024-12-02-ReasoningAgent2/index.mdx +++ b/website/blog/2024-12-02-ReasoningAgent2/index.mdx @@ -2,6 +2,7 @@ title: ReasoningAgent - Tree of Thoughts with Beam Search in AG2 authors: - Hk669 + - BabyCNM - skzhang1 - sonichi - BabyCNM @@ -74,8 +75,13 @@ Here's a simple example of using ReasoningAgent: ```python import os -from autogen import AssistantAgent, UserProxyAgent -from autogen.agentchat.contrib.reasoning_agent import ReasoningAgent, visualize_tree +from autogen import ( + AssistantAgent, + UserProxyAgent, + ReasoningAgent, + ThinkNode, + visualize_tree +) # Configure the model config_list = [{"model": "gpt-4", "api_key": os.environ.get("OPENAI_API_KEY")}]