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

Update StateFlow to use LocalCommandLineCodeExecutor #2335

Merged
merged 3 commits into from
Apr 10, 2024
Merged
Changes from 1 commit
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
36 changes: 18 additions & 18 deletions notebook/agentchat_groupchat_stateflow.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -85,30 +85,34 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/ykw5399/maintain/autogen/autogen/agentchat/user_proxy_agent.py:83: UserWarning: Using None to signal a default code_execution_config is deprecated. Use {} to use default or False to disable code execution.\n",
" super().__init__(\n"
]
}
],
"outputs": [],
"source": [
"import tempfile\n",
"\n",
"from autogen.coding import LocalCommandLineCodeExecutor\n",
"\n",
"temp_dir = tempfile.TemporaryDirectory()\n",
"executor = LocalCommandLineCodeExecutor(\n",
" timeout=10, # Timeout for each code execution in seconds.\n",
" work_dir=temp_dir.name, # Use the temporary directory to store the code files.\n",
")\n",
"\n",
"gpt4_config = {\n",
" \"cache_seed\": 42, # change the cache_seed for different trials\n",
" \"cache_seed\": False, # change the cache_seed for different trials\n",
" \"temperature\": 0,\n",
" \"config_list\": config_list,\n",
" \"timeout\": 120,\n",
"}\n",
"\n",
"initializer = autogen.UserProxyAgent(\n",
" name=\"Init\",\n",
" code_execution_config=False,\n",
")\n",
"\n",
"\n",
"\n",
"coder = autogen.AssistantAgent(\n",
" name=\"Retrieve_Action_1\",\n",
" llm_config=gpt4_config,\n",
Expand All @@ -122,11 +126,7 @@
" name=\"Retrieve_Action_2\",\n",
" system_message=\"Executor. Execute the code written by the Coder and report the result.\",\n",
" human_input_mode=\"NEVER\",\n",
" code_execution_config={\n",
" \"last_n_messages\": 3,\n",
yiranwu0 marked this conversation as resolved.
Show resolved Hide resolved
" \"work_dir\": \"paper\",\n",
" \"use_docker\": False,\n",
" }, # Please set use_docker=True if docker is available to run the generated code. Using docker is safer than running the generated code directly.\n",
" code_execution_config={\"executor\": executor},\n",
")\n",
"scientist = autogen.AssistantAgent(\n",
" name=\"Research_Action_1\",\n",
Expand Down
Loading