Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
wangshiyouyang committed Jun 14, 2024
1 parent 6e4d1c7 commit 8dd3acc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
12 changes: 5 additions & 7 deletions ai/agents/agent_instance_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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 = {
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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年第一季度的月度销售总结。它包括了每个月的总销售额、利润和订单数量的详细信息.
""",
Expand Down Expand Up @@ -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年第一季度的月度销售总结。它包括了每个月的总销售额、利润和订单数量的详细信息.
""",
Expand Down
2 changes: 1 addition & 1 deletion ai/agents/oai/completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down

0 comments on commit 8dd3acc

Please sign in to comment.