Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move ReasonAgent import from contrib to main #170

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions autogen/agentchat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -39,4 +44,7 @@
"ON_CONDITION",
"AFTER_WORK",
"AfterWorkOption",
"ReasoningAgent",
"visualize_tree",
"ThinkNode",
]
7 changes: 3 additions & 4 deletions notebook/agentchat_reasoning_agent.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -2764,7 +2763,7 @@
]
},
"kernelspec": {
"display_name": "venv",
"display_name": "base",
"language": "python",
"name": "python3"
},
Expand Down
10 changes: 8 additions & 2 deletions website/blog/2024-12-02-ReasoningAgent2/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: ReasoningAgent - Tree of Thoughts with Beam Search in AG2
authors:
- Hk669
- BabyCNM
- skzhang1
- sonichi
- BabyCNM
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicated

Expand Down Expand Up @@ -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")}]
Expand Down
Loading