mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-24 10:40:07 +08:00
fix: avoid sending empty anthropic-beta header (#11619)
Signed-off-by: f14xuanlv <2606574933@qq.com>
This commit is contained in:
parent
3e6dc56196
commit
3aedf6f138
@ -177,8 +177,12 @@ export async function buildStreamTextParams(
|
||||
let headers: Record<string, string | undefined> = options.requestOptions?.headers ?? {}
|
||||
|
||||
if (isAnthropicModel(model) && !isAwsBedrockProvider(provider)) {
|
||||
const newBetaHeaders = { 'anthropic-beta': addAnthropicHeaders(assistant, model).join(',') }
|
||||
headers = combineHeaders(headers, newBetaHeaders)
|
||||
const betaHeaders = addAnthropicHeaders(assistant, model)
|
||||
// Only add the anthropic-beta header if there are actual beta headers to include
|
||||
if (betaHeaders.length > 0) {
|
||||
const newBetaHeaders = { 'anthropic-beta': betaHeaders.join(',') }
|
||||
headers = combineHeaders(headers, newBetaHeaders)
|
||||
}
|
||||
}
|
||||
|
||||
// 构建基础参数
|
||||
|
||||
Loading…
Reference in New Issue
Block a user