docs/reasoning-standardization.md
DeepSeek uses "reasoning_content" field while OpenAI uses "reasoning" field in their chat completion streaming responses. This inconsistency caused confusion about what field name to use in the g4f Interference API.
Standardized on OpenAI's "reasoning" field format for API output while maintaining input compatibility.
The system continues to accept both input formats in OpenaiTemplate.py:
reasoning_content = choice.get("delta", {}).get("reasoning_content", choice.get("delta", {}).get("reasoning"))
reasoning field (OpenAI format)reasoning field (OpenAI format){
"id": "chatcmpl-example",
"object": "chat.completion.chunk",
"choices": [{
"index": 0,
"delta": {
"role": "assistant",
"reasoning": "I need to think about this step by step..."
},
"finish_reason": null
}]
}
{
"choices": [{
"message": {
"role": "assistant",
"content": "Here's my answer",
"reasoning": "My reasoning process was..."
}
}]
}
g4f/client/stubs.py: Updated to use reasoning field instead of reasoning_content