KwaiKEG / KwaiAgents

A generalized information-seeking agent system with Large Language Models (LLMs).
Other
1.07k stars 104 forks source link

使用kagentsys,但无法产生thought和后续动作 #25

Closed superobk closed 7 months ago

superobk commented 8 months ago

如题,正常应该像图右方所示,产生thought 但在我们环境中,使用kagentsys,无法产生thought和后续动作(如图左方),这个可以如何跟踪排查呢? ![Uploading Result.png…]()

logging as below: Question Who is Andy Lau's wife? 🤔 thinking... execution duration: 0.000s 'choices' 'choices' 'choices' 'choices' 'choices'

Traceback (most recent call last): File "/home/pgpu/Code/KwaiAgents/kwaiagents/agents/kagent.py", line 130, in taskplan response, = create_chat_completion( File "/home/pgpu/Code/KwaiAgents/kwaiagents/llms/init.py", line 44, in create_chat_completion raise RuntimeError(f"Failed to get response after {num_retries} retries") RuntimeError: Failed to get response after 5 retries

Traceback (most recent call last): File "/home/pgpu/Code/KwaiAgents/kwaiagents/agents/kagent.py", line 130, in taskplan response, = create_chat_completion( File "/home/pgpu/Code/KwaiAgents/kwaiagents/llms/init.py", line 44, in create_chat_completion raise RuntimeError(f"Failed to get response after {num_retries} retries") RuntimeError: Failed to get response after 5 retries

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/pgpu/Code/KwaiAgents/kwaiagents/agent_start.py", line 64, in chat agent_results = agent.chat( File "/home/pgpu/Code/KwaiAgents/kwaiagents/agents/kagent.py", line 270, in chat new_tasks = self.task_plan(goal, memory) File "/home/pgpu/Code/KwaiAgents/kwaiagents/agents/kagent.py", line 143, in task_plan print("+" + response) UnboundLocalError: local variable 'response' referenced before assignment

ScarletPan commented 8 months ago

hi 请问LLM的API调用正常吗

superobk commented 8 months ago

hi 请问LLM的API调用正常吗

原来是LLM的参数有问题,现在是可以调用工具了。 请问如果不用duckduckgo作为web_search工具,我能如何设置使用其他搜索引擎API呢?是否需要进行相应指令的微调? 谢谢!

ScarletPan commented 8 months ago

你好,不需要指令微调,只需要将 https://github.com/KwaiKEG/KwaiAgents/blob/main/kwaiagents/tools/search.py#L115 这边对ddg调用改成自用的搜索API即可