fix(provider): preserve custom headers and add custom-provider User-Agent setting (#635)

This commit is contained in:
Felix
2026-03-23 16:45:57 +08:00
committed by GitHub
Unverified
parent 7b1e79ed7b
commit 4d75dc1e5f
15 changed files with 144 additions and 19 deletions

View File

@@ -81,6 +81,7 @@ export function legacyProviderToAccount(provider: ProviderWithKeyInfo): Provider
label: provider.name,
authMode: provider.type === 'ollama' ? 'local' : 'api_key',
baseUrl: provider.baseUrl,
headers: provider.headers,
model: provider.model,
fallbackModels: provider.fallbackModels,
fallbackAccountIds: provider.fallbackProviderIds,

View File

@@ -44,6 +44,7 @@ export interface ProviderConfig {
type: ProviderType;
baseUrl?: string;
apiProtocol?: 'openai-completions' | 'openai-responses' | 'anthropic-messages';
headers?: Record<string, string>;
model?: string;
fallbackModels?: string[];
fallbackProviderIds?: string[];
@@ -107,6 +108,7 @@ export interface ProviderAccount {
authMode: ProviderAuthMode;
baseUrl?: string;
apiProtocol?: 'openai-completions' | 'openai-responses' | 'anthropic-messages';
headers?: Record<string, string>;
model?: string;
fallbackModels?: string[];
fallbackAccountIds?: string[];