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

openrouter/deepseek/deepseek-r1:free with "KeyError: 'tool_calls'" #19

Open
Yang011013 opened this issue Feb 21, 2025 · 1 comment
Open

Comments

@Yang011013
Copy link

hello, when I run this command "COMPLETION_MODEL=openrouter/deepseek/deepseek-r1:free auto main". I got the errors:

[?] Please select the mode:: 
 > user mode
   agent editor
   workflow editor
   exit

Coming soon...
Tell me what you want to do (type "exit" to quit): what's the average retirement age for chinese?
Your request: what's the average retirement age for chinese? 
@System Triage Agent will help you, be patient...
Traceback (most recent call last):
  File "/home/zhongkeyang/miniconda3/envs/metachain/bin/auto", line 8, in <module>
    sys.exit(cli())
  File "/home/zhongkeyang/miniconda3/envs/metachain/lib/python3.10/site-packages/click/core.py", line 1161, in __call__
    return self.main(*args, **kwargs)
  File "/home/zhongkeyang/miniconda3/envs/metachain/lib/python3.10/site-packages/click/core.py", line 1082, in main
    rv = self.invoke(ctx)
  File "/home/zhongkeyang/miniconda3/envs/metachain/lib/python3.10/site-packages/click/core.py", line 1697, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/zhongkeyang/miniconda3/envs/metachain/lib/python3.10/site-packages/click/core.py", line 1443, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/zhongkeyang/miniconda3/envs/metachain/lib/python3.10/site-packages/click/core.py", line 788, in invoke
    return __callback(*args, **kwargs)
  File "/data1/zhongkeyang/AutoAgent/autoagent/cli.py", line 207, in main
    user_mode(model, context_variables, False)
  File "/data1/zhongkeyang/AutoAgent/autoagent/cli.py", line 273, in user_mode
    response = client.run(agent, messages, context_variables, debug=debug)
  File "/data1/zhongkeyang/AutoAgent/autoagent/core.py", line 383, in run
    completion = self.get_chat_completion(
  File "/home/zhongkeyang/miniconda3/envs/metachain/lib/python3.10/site-packages/tenacity/__init__.py", line 336, in wrapped_f
    return copy(f, *args, **kw)
  File "/home/zhongkeyang/miniconda3/envs/metachain/lib/python3.10/site-packages/tenacity/__init__.py", line 475, in __call__
    do = self.iter(retry_state=retry_state)
  File "/home/zhongkeyang/miniconda3/envs/metachain/lib/python3.10/site-packages/tenacity/__init__.py", line 376, in iter
    result = action(retry_state)
  File "/home/zhongkeyang/miniconda3/envs/metachain/lib/python3.10/site-packages/tenacity/__init__.py", line 398, in <lambda>
    self._add_action_func(lambda rs: rs.outcome.result())
  File "/home/zhongkeyang/miniconda3/envs/metachain/lib/python3.10/concurrent/futures/_base.py", line 451, in result
    return self.__get_result()
  File "/home/zhongkeyang/miniconda3/envs/metachain/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
    raise self._exception
  File "/home/zhongkeyang/miniconda3/envs/metachain/lib/python3.10/site-packages/tenacity/__init__.py", line 478, in __call__
    result = fn(*args, **kwargs)
  File "/data1/zhongkeyang/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
@Yang011013
Copy link
Author

but when I type "hello" after the "Tell me what you want to do (type "exit" to quit):", I got these:

Tell me what you want to do (type "exit" to quit): hello
Your request: hello 
@System Triage Agent will help you, be patient...
[{'role': 'assistant', 'content': 'Alright, the user said "hello". I need to respond appropriately. Since it\'s a greeting, there\'s no need to transfer to another agent. The case can be resolved immediately here.\n\nThe required response should be friendly and helpful. Just greet them back and offer assistance. Since the case is resolved with that response, I\'ll use case_resolved with the result encapsulated in <solution> tags.\n<function=case_resolved>\n<parameter=result>Hello! How can I assist you today?</parameter>\n</function>'}]
[{'role': 'assistant', 'content': 'Alright, the user said "hello". I need to respond appropriately. Since it\'s a greeting, there\'s no need to transfer to another agent. The case can be resolved immediately here.\n\nThe required response should be friendly and helpful. Just greet them back and offer assistance. Since the case is resolved with that response, I\'ll use case_resolved with the result encapsulated in <solution> tags.', 'tool_calls': [{'index': 1, 'id': 'toolu_01', 'type': 'function', 'function': {'name': 'case_resolved', 'arguments': '{"result": "Hello! How can I assist you today?"}'}}]}]
@System Triage Agent has finished with the response:
 Case resolved. No further actions are needed. The result of the case resolution is: Hello! How can I assist you today?
Tell me what you want to do (type "exit" to quit):

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

1 participant