This commit is contained in:
自由的世界人
2025-07-26 11:33:12 +08:00
committed by GitHub
parent 26bd9203e1
commit 07f2a663c1
3 changed files with 11 additions and 7 deletions
@@ -545,11 +545,15 @@ export class OpenAIAPIClient extends OpenAIBaseClient<
}
// Create the appropriate parameters object based on whether streaming is enabled
// Note: Some providers like Mistral don't support stream_options
const mistralProviders = ['mistral']
const shouldIncludeStreamOptions = streamOutput && !mistralProviders.includes(this.provider.id)
const sdkParams: OpenAISdkParams = streamOutput
? {
...commonParams,
stream: true,
stream_options: { include_usage: true }
...(shouldIncludeStreamOptions ? { stream_options: { include_usage: true } } : {})
}
: {
...commonParams,