KwaiKEG/KwaiAgents

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

Closed this issue · 3 comments

如题,正常应该像图右方所示,产生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 task_plan
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 task_plan
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

hi 请问LLM的API调用正常吗

hi 请问LLM的API调用正常吗

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

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