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

Add Reasoning Content support to OpenAiChatModel and related classes (For deepseek-reasoner) #2192

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

apappascs
Copy link
Contributor

@apappascs apappascs commented Feb 7, 2025

This PR resolves: #2283 by adding reasoning content support to OpenAiChatModel and related classes, following the approach of this 45421b1 .

Reasoning Content Details

reasoning_content : string / nullable  
For DeepSeek-Reasoner model only. Represents the reasoning contents of the assistant's message before the final answer.  

Refer to the DeepSeek API documentation for more details: API Docs.

Changes in This PR
• Added reasoningContent field to metadata in OpenAiChatModel.
• Updated ChatCompletionMessage to include reasoningContent.

With this implementation, we can build projects like DeepClaude, enabling the integration of DeepSeek R1’s logical reasoning capabilities with Anthropic Claude’s (or any other model’s) creative and coding prowess. This will provide a powerful, combined language model experience.

@apappascs apappascs force-pushed the feature/add-reasoning-content-support branch from 33c997c to e3947c2 Compare February 7, 2025 17:41
…For deepseek-reasoner https://api-docs.deepseek.com/api/create-chat-completion)

- Added reasoningContent field to metadata in OpenAiChatModel
- Updated ChatCompletionMessage to include reasoningContent
- Modified OpenAiStreamFunctionCallingHelper to handle reasoningContent
- Updated tests to verify reasoningContent functionality

Signed-off-by: Alexandros Pappas <[email protected]>
Copy link

@yangshaotuo yangshaotuo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When can it be officially used

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

Successfully merging this pull request may close these issues.

Output of reasoning_content that supports deepseek-r1 is required
4 participants