diff --git a/ai/agents/agent_instance_util.py b/ai/agents/agent_instance_util.py index 34d591b3..15eaaa6c 100644 --- a/ai/agents/agent_instance_util.py +++ b/ai/agents/agent_instance_util.py @@ -60,7 +60,6 @@ def __init__( self.openai_proxy = None self.db_id = db_id - def set_api_key(self, api_key, ApiType="openai", api_host=None, ApiModel=None, LlmSetting=None): self.api_key = api_key if api_host is not None: @@ -203,6 +202,7 @@ def get_agent_mysql_engineer(self): Hand over your code to the Executor for execution. Don’t query too much data, Try to merge query data as simply as possible. Be careful to avoid using mysql special keywords in mysql code. + If function call is needed, the function name mast be 'run_mysql_code', be sure contains no other characters. Reply "TERMINATE" in the end when everything is done. ''', websocket=self.websocket, @@ -381,7 +381,6 @@ def get_agent_mongodb_engineer(self): """ return mongodb_engineer - def get_agent_chart_presenter_old(self): """chart designer""" chart_llm_config = { @@ -819,7 +818,6 @@ def get_agent_task_selector(self): return task_selector def get_agent_task_planner(self): - """ Make plans for tasks and assign tasks to other agents step by step """ task_planner = TaskPlannerAgent( name="task_planner", @@ -1377,8 +1375,8 @@ async def task_generate_report(self, qustion_message): analyst, message=str( answer_contents) + '\n' + " 以下是我的问题,请用中文回答: " + '\n' + " 1,本次生成哪些报表?简单描述一下各报表 " - + '\n' + " 以下是一个回答案例: " + '\n' + - """总结: + + '\n' + " 以下是一个回答案例: " + '\n' + + """总结: -- Monthly Sales Summary Q1 2019: 同名图表历史已生成过,此次不再生成,若要重新生成图表,请先删除已有同名报表。2019年第一季度的月度销售总结。它包括了每个月的总销售额、利润和订单数量的详细信息. -- Summary Q1 2018: 生成成功。2018年第一季度的月度销售总结。它包括了每个月的总销售额、利润和订单数量的详细信息. """, @@ -1536,8 +1534,8 @@ async def task_generate_report1108(self, qustion_message): analyst, message=str( answer_contents) + '\n' + " 以下是我的问题,请用中文回答: " + '\n' + " 1,本次生成哪些报表?简单描述一下各报表 " - + '\n' + " 以下是一个回答案例: " + '\n' + - """总结: + + '\n' + " 以下是一个回答案例: " + '\n' + + """总结: -- Monthly Sales Summary Q1 2019: 同名图表历史已生成过,此次不再生成,若要重新生成图表,请先删除已有同名报表。2019年第一季度的月度销售总结。它包括了每个月的总销售额、利润和订单数量的详细信息. -- Summary Q1 2018: 生成成功。2018年第一季度的月度销售总结。它包括了每个月的总销售额、利润和订单数量的详细信息. """, diff --git a/ai/agents/oai/completion.py b/ai/agents/oai/completion.py index 2e442030..bd12c0d9 100644 --- a/ai/agents/oai/completion.py +++ b/ai/agents/oai/completion.py @@ -214,7 +214,7 @@ def _get_response(cls, config: Dict, raise_on_ratelimit_or_timeout=False, use_ca other_llm_name = AGENT_LLM_MODEL[agent_name]['llm'] if agent_name in AGENT_LLM_MODEL and \ AGENT_LLM_MODEL[agent_name][ 'replace_default'] and llm_setting is not None else use_llm_name - use_api_secret = llm_setting[use_llm_name]['ApiSecret'] if "ApiSecret" in llm_setting[use_llm_name] else None + use_api_secret = llm_setting[use_llm_name]['ApiSecret'] if llm_setting and "ApiSecret" in llm_setting[use_llm_name] else None print("Agent_name", agent_name, 'default: llm:', use_llm_name, "url:", use_url, "model", use_model, "other LLM", other_llm_name) if other_llm_name is not None and use_llm_name != other_llm_name: use_message_count = AGENT_LLM_MODEL[agent_name]['use_message_count']