From 2feda6fe456e84f8ace78f8a0666ca7bcab9f8b6 Mon Sep 17 00:00:00 2001 From: Linxin Song Date: Fri, 15 Dec 2023 17:32:02 +0800 Subject: [PATCH] solve #954 --- autogen/agentchat/contrib/agent_builder.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/autogen/agentchat/contrib/agent_builder.py b/autogen/agentchat/contrib/agent_builder.py index f5db9ef4278..2e60642dd4a 100644 --- a/autogen/agentchat/contrib/agent_builder.py +++ b/autogen/agentchat/contrib/agent_builder.py @@ -285,14 +285,6 @@ def build( """ use_api = False - if code_execution_config is None: - code_execution_config = { - "last_n_messages": 2, - "work_dir": "groupchat", - "use_docker": False, - "timeout": 60, - } - if cached_configs is None: use_api = True agent_configs = [] @@ -302,6 +294,15 @@ def build( default_llm_config = cached_configs["default_llm_config"] coding = cached_configs["coding"] agent_configs = cached_configs["agent_configs"] + code_execution_config = cached_configs['code_execution_config'] + + if code_execution_config is None: + code_execution_config = { + "last_n_messages": 2, + "work_dir": "groupchat", + "use_docker": False, + "timeout": 60, + } if use_api: config_list = autogen.config_list_from_json(self.config_path, filter_dict={"model": [self.builder_model]})