#DeepSeek V3.1: The reasoning is empty, and is added to the final message

1 messages · Page 1 of 1 (latest)

cerulean lion
#

I'm using AI SDK with OpenRouter ai-sdk-provider.

The reasoning is empty, and is added to the final message, take a look to the image.

I'm using the model: DeepSeek V3.1

This is my configuration:

'chat-model': wrapLanguageModel({
  model: openrouter('deepseek/deepseek-chat-v3.1'),
  middleware: extractReasoningMiddleware({ tagName: 'think' }),
}),

Dependencies:

"@ai-sdk/react": "^1.2.12",
"@openrouter/ai-sdk-provider": "^0.7.5",
"ai": "^4.3.19",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"next": "^15.3.4",
vale willowBOT
#

I'm an AI assistant - my answers may be incorrect and I cannot see screenshots. Please verify information with the OpenRouter docs.

To help debug the "reasoning is empty, and is added to the final message" issue with DeepSeek V3.1 and your AI SDK config, I need a bit more detail:

  1. Can you provide the exact API response you're getting for a sample request (including the message content and any reasoning field)?
  2. Is this behavior happening for every prompt, or only specific ones?
  3. Can you share a minimal code sample (besides the config) showing how you are calling the chat model and handling the output?

These details will help determine if the issue is with the model output, the middleware, or the SDK integration. For more info on third-party SDKs, see the OpenRouter frameworks documentation.

-# This is an automated response powered by Answer HQ. Use !mute to stop the bot from responding.

The author you are looking for could not be found.

cerulean lion
#

this is API response:

[
    {
        "id": "5192b330-8478-4cd2-a347-e38f5a7a4bec",
        "chatId": "2cbe9177-020a-4ffe-8f15-3308c1fdd165",
        "role": "user",
        "parts": [
            {
                "text": "Hello, what is your name?",
                "type": "text"
            }
        ],
        "attachments": [],
        "createdAt": "2025-08-24T01:21:20.879Z"
    },
    {
        "id": "e6cb68a4-c762-4fb3-aaf6-c1c93e7b6902",
        "chatId": "2cbe9177-020a-4ffe-8f15-3308c1fdd165",
        "role": "assistant",
        "parts": [
            {
                "type": "step-start"
            },
            {
                "type": "reasoning",
                "reasoning": "",
                "details": [
                    {
                        "type": "text",
                        "text": ""
                    }
                ]
            },
            {
                "type": "text",
                "text": "Hmm, the user is asking for my name. This is a simple introductory question. I should respond with my name and a friendly greeting to start the conversation. \n\nI'll keep it warm and inviting by introducing myself as \"Weather Assistant\" since I have weather-related capabilities, and then ask how I can help them today. This sets a positive tone for the interaction. \n\nThe response should be concise but welcoming - no need for lengthy explanations since this is just an introduction.Hello! I'm Weather Assistant. How can I help you today?"
            }
        ],
        "attachments": [],
        "createdAt": "2025-08-24T01:21:23.387Z"
    }
]