Skip to content

OpenAI-Compatible Adapter Resoning /Thinking Mode not working #982

Description

@devshahoriar

TanStack AI version

"@tanstack/ai": "^0.42.0",

Framework/Library version

"react": "19.2.3","expo": "~57.0.7",

Describe the bug and the steps to reproduce it

// Enable reasoning/thinking extraction for DeepSeek reasoning_content
;(OpenAICompatibleChatAdapter.prototype as any).extractReasoning = function (
chunk: any,
) {
const delta = chunk?.choices?.[0]?.delta
const text = delta?.reasoning_content || delta?.reasoning
if (text) {
return { text }
}
return undefined
}

export const deepseek = openaiCompatible({
name: 'deepseek',
baseURL: 'https://api.deepseek.com/v1',
apiKey: env.DEEPSEEK_API_KEY,
models: ['deepseek-chat', 'deepseek-reasoner'],
}) as any

copilot suggest me to do this for resoning

Your Minimal, Reproducible Example - (Sandbox Highly Recommended)

given

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

None

Terms & Code of Conduct

  • I agree to follow this project's Code of Conduct
  • I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

has-prAn open PR references this issuewaiting-on: maintainerThe ball is in the maintainers’ court

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions