File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,6 @@ export function openRouterLanguageModel(model: Model) {
3737 extraBody,
3838 } ) . languageModel ( model , {
3939 usage : { include : true } ,
40- includeReasoning : true ,
4140 logprobs : true ,
4241 } )
4342}
Original file line number Diff line number Diff line change @@ -29,7 +29,10 @@ import type {
2929 OpenAIModel ,
3030} from '@codebuff/common/constants'
3131import type { CodebuffMessage , Message } from '@codebuff/common/types/message'
32- import type { OpenRouterUsageAccounting } from '@openrouter/ai-sdk-provider'
32+ import type {
33+ OpenRouterProviderOptions ,
34+ OpenRouterUsageAccounting ,
35+ } from '@openrouter/ai-sdk-provider'
3336import type { AssistantModelMessage , UserModelMessage , LanguageModel } from 'ai'
3437import type { z } from 'zod/v4'
3538
@@ -128,6 +131,15 @@ export const promptAiSdkStream = async function* (
128131 } )
129132 }
130133 if ( chunk . type === 'reasoning-delta' ) {
134+ if (
135+ (
136+ options . providerOptions ?. openrouter as
137+ | OpenRouterProviderOptions
138+ | undefined
139+ ) ?. reasoning ?. exclude
140+ ) {
141+ continue
142+ }
131143 if ( ! reasoning ) {
132144 reasoning = true
133145 yield `${ startToolTag } {
You can’t perform that action at this time.
0 commit comments