We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
当前的 function call 官方文档 https://platform.deepseek.com/api-docs/guides/function_calling
最新的 openai python sdk openai==1.42.0
openai==1.42.0
messages = [{"role": "user", "content": "How's the weather in Hangzhou?"}] message = send_messages(messages) print(f"User>\t {messages[0]['content']}") tool = message.tool_calls[0] messages.append(message)
直接访问 message.tool_calls 会报错 AttributeError
message.tool_calls
Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/ilya/.cache/pypoetry/virtualenvs/buffett-4Wtakw1Y-py3.12/lib/python3.12/site-packages/pydantic/main.py", line 828, in __getattr__ raise AttributeError(f'{type(self).__name__!r} object has no attribute {item!r}') AttributeError: 'ChatCompletion' object has no attribute 'tool_calls'
看了下 openai 的 doc https://platform.openai.com/docs/guides/function-calling , 协议有些变化, function call 是在 Choice 里
Choice( finish_reason='tool_calls', index=0, logprobs=None, message=chat.completionsMessage( content=None, role='assistant', function_call=None, tool_calls=[ chat.completionsMessageToolCall( id='call_62136354', function=Function( arguments='{"order_id":"order_12345"}', name='get_delivery_date'), type='function') ]) )
The text was updated successfully, but these errors were encountered:
No branches or pull requests
当前的 function call 官方文档 https://platform.deepseek.com/api-docs/guides/function_calling
最新的 openai python sdk
openai==1.42.0
直接访问
message.tool_calls
会报错 AttributeError看了下 openai 的 doc https://platform.openai.com/docs/guides/function-calling , 协议有些变化, function call 是在 Choice 里
The text was updated successfully, but these errors were encountered: