Deepseek with reasoning
Error code: 400 - {‘error’: {‘message’: ‘Missing reasoning_content field in the assistant message at message index 2. For more information, please refer to https://api-docs.deepseek.com/guides/thinking_with_tools’, ‘type’: ‘invalid_request_error’, ‘param’: None, ‘code’: ‘invalid_request_error’}}
Code:
prompt = ChatPromptTemplate.from_messages(messages)
chain = prompt | llm
res = chain.invoke(
{"chat_history": chat_history}
)
Message:
{
"role": "assistant",
"content": "",
"tool_calls": [
{
"name": "sum",
"args": {
"a": 235324,
"b": 432432
},
"id": "call_00_ioodMHzdzdKM5q3hMQ4PmgAl",
"type": "tool_call"
}
],
"additional_kwargs": {
"refusal": null,
"reasoning_content": "O usuário está perguntando sobre uma soma: 235324 + 432432. Posso usar a função \"sum\" para calcular isso. Vou invocar a função com os parâmetros a e b."
}
}
reasoning_content is being sent within additional_kwargs, how can I send it at the same level as the content?