mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-08 22:39:36 +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 ?? {}
|
let headers: Record<string, string | undefined> = options.requestOptions?.headers ?? {}
|
||||||
|
|
||||||
if (isAnthropicModel(model) && !isAwsBedrockProvider(provider)) {
|
if (isAnthropicModel(model) && !isAwsBedrockProvider(provider)) {
|
||||||
const newBetaHeaders = { 'anthropic-beta': addAnthropicHeaders(assistant, model).join(',') }
|
const betaHeaders = addAnthropicHeaders(assistant, model)
|
||||||
headers = combineHeaders(headers, newBetaHeaders)
|
// 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