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

tool_calls #18

Open
Ravikumarkatta opened this issue Feb 18, 2025 · 5 comments
Open

tool_calls #18

Ravikumarkatta opened this issue Feb 18, 2025 · 5 comments

Comments

@Ravikumarkatta
Copy link

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""

@tjb-tech
Copy link
Collaborator

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?

@Ravikumarkatta
Copy link
Author

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
Copy link
Author

Ravikumarkatta commented Feb 18, 2025

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 Ravikumarkatta changed the title tool_choice tool_calls Feb 18, 2025
@Ravikumarkatta
Copy link
Author

I'm seeking for reply

@tjb-tech
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants