AutoAgent icon indicating copy to clipboard operation
AutoAgent copied to clipboard

tool_calls

Open Ravikumarkatta opened this issue 10 months ago • 7 comments

please fix

"File "D:\auto\AutoAgent\autoagent\core.py", line 134, in get_chat_completion assert agent.tool_choice == "required", f"Non-function calling mode MUST use tool_choice = 'required' rather than {agent.tool_choice}" AssertionError: Non-function calling mode MUST use tool_choice = 'required' rather than None""

Ravikumarkatta avatar Feb 18 '25 10:02 Ravikumarkatta

please fix

"File "D:\auto\AutoAgent\autoagent\core.py", line 134, in get_chat_completion assert agent.tool_choice == "required", f"Non-function calling mode MUST use tool_choice = 'required' rather than {agent.tool_choice}" AssertionError: Non-function calling mode MUST use tool_choice = 'required' rather than None""

May I ask for the detailed command you use with our AutoAgent framework to let us better fix your issue?

tjb-tech avatar Feb 18 '25 12:02 tjb-tech

user mode agent editor workflow editor exit

Coming soon... Tell me what you want to do (type "exit" to quit): hi Your request: hi @System Triage Agent will help you, be patient... Traceback (most recent call last): File "", line 198, in run_module_as_main File "", line 88, in run_code File "D:\auto\venv\Scripts\auto.exe_main.py", line 7, in File "D:\auto\venv\Lib\site-packages\click\core.py", line 1161, in call return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\auto\venv\Lib\site-packages\click\core.py", line 1082, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "D:\auto\venv\Lib\site-packages\click\core.py", line 1697, in invoke return process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\auto\venv\Lib\site-packages\click\core.py", line 1443, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\auto\venv\Lib\site-packages\click\core.py", line 788, in invoke return callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\auto\AutoAgent\autoagent\cli.py", line 206, in main user_mode(model, context_variables, False) File "D:\auto\AutoAgent\autoagent\cli.py", line 269, in user_mode response = client.run(agent, messages, context_variables, debug=debug) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\auto\AutoAgent\autoagent\core.py", line 383, in run completion = self.get_chat_completion( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\auto\venv\Lib\site-packages\tenacity_init.py", line 336, in wrapped_f return copy(f, *args, **kw) ^^^^^^^^^^^^^^^^^^^^ File "D:\auto\venv\Lib\site-packages\tenacity_init.py", line 475, in call do = self.iter(retry_state=retry_state) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\auto\venv\Lib\site-packages\tenacity_init.py", line 376, in iter result = action(retry_state) ^^^^^^^^^^^^^^^^^^^ File "D:\auto\venv\Lib\site-packages\tenacity_init.py", line 398, in self._add_action_func(lambda rs: rs.outcome.result()) ^^^^^^^^^^^^^^^^^^^ File "C:\Users\ravi\AppData\Local\Programs\Python\Python312\Lib\concurrent\futures_base.py", line 449, in result return self.__get_result() ^^^^^^^^^^^^^^^^^^^ File "C:\Users\ravi\AppData\Local\Programs\Python\Python312\Lib\concurrent\futures_base.py", line 401, in __get_result raise self.exception File "D:\auto\venv\Lib\site-packages\tenacity_init.py", line 478, in call result = fn(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^ File "D:\auto\AutoAgent\autoagent\core.py", line 162, in get_chat_completion converted_tool_calls = [ChatCompletionMessageToolCall(**tool_call) for tool_call in converted_message[0]["tool_calls"]] ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^ KeyError: 'tool_calls'

ravi@ERROR MINGW64 /d/auto/autoagent (main) $

Ravikumarkatta avatar Feb 18 '25 13:02 Ravikumarkatta

Leave first issue because I did not configured anthropic api key and It happens after I have shut down the system all the command gone. A s again I'm facing "key error:tool_calls" Above(second) comment where I have added when I'm using deepseek r1 model

Ravikumarkatta avatar Feb 18 '25 13:02 Ravikumarkatta

I'm seeking for reply

Ravikumarkatta avatar Feb 20 '25 10:02 Ravikumarkatta

I'm seeking for reply

Hiii, sorry for the late reply. So in my understanding, the error AssertionError: Non-function calling mode MUST use tool_choice = 'required' rather than None"" occurs when you try to use deepseek model for agent or workflow profiling, right? You may need to give me the detailed command of each case, which means you command like auto main .... Only error information may not be enough.

tjb-tech avatar Feb 20 '25 10:02 tjb-tech

I went the same problem used DeepSeek API

larryfans avatar Mar 10 '25 02:03 larryfans

I'm seeking for reply

Hiii, sorry for the late reply. So in my understanding, the error AssertionError: Non-function calling mode MUST use tool_choice = 'required' rather than None"" occurs when you try to use deepseek model for agent or workflow profiling, right? You may need to give me the detailed command of each case, which means you command like auto main .... Only error information may not be enough.

This is my command: COMPLETION_MODEL=deepseek/deepseek-chat auto main COMPLETION_MODEL=deepseek/deepseek-chat auto main --git_clone=true --test_pull_name=autoagent_mirror

larryfans avatar Mar 10 '25 02:03 larryfans