feat: 添加工具类型和用法说明,支持自定义 API 头部设置

This commit is contained in:
catlog22
2026-01-12 11:41:04 +08:00
parent bdd545727b
commit 52c510501d
3 changed files with 34 additions and 2 deletions

View File

@@ -198,6 +198,14 @@ export async function executeLiteLLMEndpoint(
}
}
// Set custom headers from provider advanced settings
if (provider.advancedSettings?.customHeaders) {
process.env['CCW_LITELLM_EXTRA_HEADERS'] = JSON.stringify(provider.advancedSettings.customHeaders);
} else {
// Clear any previous custom headers
delete process.env['CCW_LITELLM_EXTRA_HEADERS'];
}
// Use litellm-client to call chat
const response = await callWithRetries(
() => client.chat(finalPrompt, endpoint.model),