Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FunctionCallSchemaError: No function call found in the response #408

Open
busishengui opened this issue Jul 16, 2024 · 0 comments
Open

FunctionCallSchemaError: No function call found in the response #408

busishengui opened this issue Jul 16, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@busishengui
Copy link

Issue Description / 问题描述

=-=-=-=-=-=-=Recorder End-=-=-=-=-=-=-=
chatcompletion: using gpt-4
FunctionCallSchemaError: No function call found in the response
chatcompletion: using gpt-4
FunctionCallSchemaError: No function call found in the response
chatcompletion: using gpt-4
FunctionCallSchemaError: No function call found in the response
Traceback (most recent call last):
File "/home/kailong/.conda/envs/multi_llm_agent/lib/python3.10/site-packages/tenacity/init.py", line 478, in call
result = fn(*args, **kwargs)
File "/home/kailong/env/XAgent/XAgent/ai_functions/request/obj_generator.py", line 72, in chatcompletion
response = self.function_call_refine(kwargs,response)
File "/home/kailong/env/XAgent/XAgent/ai_functions/request/obj_generator.py", line 191, in function_call_refine
raise FunctionCallSchemaError(f"No function call found in the response: {response['choices'][0]['message']} ")
XAgent.ai_functions.request.error.FunctionCallSchemaError: No function call found in the response: {'content': 'Given the successful access to CNKI and its advanced search features, the next logical step involves conducting a targeted search for the TACT trial information. This entails leveraging CNKI's advanced search functionality to locate information specifically related to the TACT trial. Our objective is to find data on the number of patients randomized in the TACT trial. Given the complexity and precision required for this search, we must formulate a detailed and focused search query that aligns with CNKI's search capabilities.\n\nConsidering CNKI's search features, the search must consider various parameters, including the possible titles, keywords, or authors related to the TACT trial. Understanding that CNKI supports complex search operations, using operators for a more accurate search might be beneficial. For instance, using operators to combine keywords such as "TACT trial" AND "patients randomized" could narrow down the search results effectively.\n\nGiven our current understanding and the features offered by CNKI, an appropriate next action would be to utilize CNKI's advanced search with a carefully constructed query aiming to isolate records specifically mentioning the TACT trial and details regarding patient randomization.\n\nI will proceed with browsing the CNKI website with a specific goal in mind, using the advanced search feature to perform this detailed search. For this, an exact search query will be crafted considering CNKI's search syntax for optimal results.\n\njson\n{\n "tool_name": "WebEnv_search_and_browse",\n "tool_input": {\n "search_query": "TACT试验 AND 患者随机化",\n "goals_to_browse": "Find precise details related to the number of patients randomized in the TACT trial.",\n "region": "zh-CN"\n }\n}\n', 'role': 'assistant'}

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/kailong/env/XAgent/XAgentServer/server.py", line 104, in interact
task_handler.outer_loop()
File "/home/kailong/env/XAgent/XAgent/workflow/task_handler.py", line 138, in outer_loop
search_method = self.inner_loop(self.now_dealing_task)
File "/home/kailong/env/XAgent/XAgent/workflow/task_handler.py", line 241, in inner_loop
search_method.run(config=self.config,
File "/home/kailong/env/XAgent/XAgent/inner_loop_search_algorithms/ReACT.py", line 104, in run
self.generate_chain(config, agent, arguments,
File "/home/kailong/env/XAgent/XAgent/inner_loop_search_algorithms/ReACT.py", line 272, in generate_chain
new_message, tokens = agent.parse(
File "/home/kailong/.conda/envs/multi_llm_agent/lib/python3.10/site-packages/tenacity/init.py", line 336, in wrapped_f
return copy(f, *args, **kw)
File "/home/kailong/.conda/envs/multi_llm_agent/lib/python3.10/site-packages/tenacity/init.py", line 475, in call
do = self.iter(retry_state=retry_state)
File "/home/kailong/.conda/envs/multi_llm_agent/lib/python3.10/site-packages/tenacity/init.py", line 376, in iter
result = action(retry_state)
File "/home/kailong/.conda/envs/multi_llm_agent/lib/python3.10/site-packages/tenacity/init.py", line 418, in exc_check
raise retry_exc.reraise()
File "/home/kailong/.conda/envs/multi_llm_agent/lib/python3.10/site-packages/tenacity/init.py", line 185, in reraise
raise self.last_attempt.result()
File "/home/kailong/.conda/envs/multi_llm_agent/lib/python3.10/concurrent/futures/_base.py", line 451, in result
return self.__get_result()
File "/home/kailong/.conda/envs/multi_llm_agent/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
raise self._exception
File "/home/kailong/.conda/envs/multi_llm_agent/lib/python3.10/site-packages/tenacity/init.py", line 478, in call
result = fn(*args, **kwargs)
File "/home/kailong/env/XAgent/XAgent/agent/tool_agent/agent.py", line 92, in parse
message,tokens = self.generate(
File "/home/kailong/env/XAgent/XAgent/agent/base_agent.py", line 121, in generate
response = objgenerator.chatcompletion(
File "/home/kailong/.conda/envs/multi_llm_agent/lib/python3.10/site-packages/tenacity/init.py", line 336, in wrapped_f
return copy(f, *args, **kw)
File "/home/kailong/.conda/envs/multi_llm_agent/lib/python3.10/site-packages/tenacity/init.py", line 475, in call
do = self.iter(retry_state=retry_state)
File "/home/kailong/.conda/envs/multi_llm_agent/lib/python3.10/site-packages/tenacity/init.py", line 376, in iter
result = action(retry_state)
File "/home/kailong/.conda/envs/multi_llm_agent/lib/python3.10/site-packages/tenacity/init.py", line 419, in exc_check
raise retry_exc from fut.exception()
tenacity.RetryError: RetryError[<Future at 0x7f643318a710 state=finished raised FunctionCallSchemaError>]

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/kailong/env/XAgent/command.py", line 273, in task_handler
server.interact(interaction=interaction)
File "/home/kailong/env/XAgent/XAgentServer/server.py", line 106, in interact
raise XAgentRunningError(str(e)) from e
XAgentServer.exts.exception_ext.XAgentRunningError: RetryError[<Future at 0x7f643318a710 state=finished raised FunctionCallSchemaError>]
Error in task_handler of 684037a5c8374baeb6f044c5580d83d7: RetryError[<Future at 0x7f643318a710 state=finished raised FunctionCallSchemaError>]

Steps to Reproduce / 复现步骤

python run.py --task "如果需要网络请使用中国的网站,请用中文回答:what's the difference between the number of the patients randomized in the TACT trial and the TACT2 trial?" --config-file "assets/gpt4_config.yml"

Expected Behavior / 预期行为

希望不要崩溃

Environment / 环境信息

  • Operating System / 操作系统:Linux
  • Python Version / Python 版本:3.10
  • Other Relevant Information / 其他相关信息:

Error Screenshots or Logs / 错误截图或日志

If possible, please provide relevant screenshots or logs of the error. / 如果可能,请提供相关的错误截图或日志文件。

Additional Notes / 其他备注

If you have any additional information or notes, please add them here. / 如果有其他补充信息,请在此处添加。

@busishengui busishengui added the bug Something isn't working label Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant