mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-11 16:39:15 +08:00
fix(aiCore): only apply sendReasoning for openai-compatible SDK providers (#12387)
sendReasoning is a patch specific to @ai-sdk/openai-compatible package. Previously it was incorrectly applied to all providers in buildGenericProviderOptions, including those with dedicated SDK packages (e.g., cerebras, deepseek, openrouter). Now it only applies when the provider will actually use openai-compatible SDK: - No dedicated SDK registered (!hasProviderConfig(providerId)) - OR explicitly openai-compatible (providerId === 'openai-compatible') 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
76cc196667
commit
29d8c4a7ed
@ -3,7 +3,7 @@ import { type AnthropicProviderOptions } from '@ai-sdk/anthropic'
|
||||
import type { GoogleGenerativeAIProviderOptions } from '@ai-sdk/google'
|
||||
import type { OpenAIResponsesProviderOptions } from '@ai-sdk/openai'
|
||||
import type { XaiProviderOptions } from '@ai-sdk/xai'
|
||||
import { baseProviderIdSchema, customProviderIdSchema } from '@cherrystudio/ai-core/provider'
|
||||
import { baseProviderIdSchema, customProviderIdSchema, hasProviderConfig } from '@cherrystudio/ai-core/provider'
|
||||
import { loggerService } from '@logger'
|
||||
import {
|
||||
getModelSupportedVerbosity,
|
||||
@ -616,9 +616,14 @@ function buildGenericProviderOptions(
|
||||
}
|
||||
if (enableReasoning) {
|
||||
if (isInterleavedThinkingModel(model)) {
|
||||
providerOptions = {
|
||||
...providerOptions,
|
||||
sendReasoning: true
|
||||
// sendReasoning is a patch specific to @ai-sdk/openai-compatible
|
||||
// Only apply when provider will actually use openai-compatible SDK
|
||||
// (i.e., no dedicated SDK registered OR explicitly openai-compatible)
|
||||
if (!hasProviderConfig(providerId) || providerId === 'openai-compatible') {
|
||||
providerOptions = {
|
||||
...providerOptions,
|
||||
sendReasoning: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user