diff --git a/src/config/claudeProviderPresets.ts b/src/config/claudeProviderPresets.ts index 44cc048f..8d82386f 100644 --- a/src/config/claudeProviderPresets.ts +++ b/src/config/claudeProviderPresets.ts @@ -8,6 +8,8 @@ export interface TemplateValueConfig { placeholder: string; defaultValue?: string; editorValue: string; + optional?: boolean; // 可选字段,不参与必填校验 + isSecret?: boolean; // 密码字段,使用 password 类型渲染 } /** @@ -532,9 +534,10 @@ export const providerPresets: ProviderPreset[] = [ iconColor: "#000000", }, { - name: "AWS Bedrock (AKSK)", + name: "AWS Bedrock", websiteUrl: "https://aws.amazon.com/bedrock/", settingsConfig: { + apiKey: "${BEDROCK_API_KEY}", env: { ANTHROPIC_BASE_URL: "https://bedrock-runtime.${AWS_REGION}.amazonaws.com", @@ -557,50 +560,24 @@ export const providerPresets: ProviderPreset[] = [ placeholder: "us-west-2", editorValue: "us-west-2", }, + BEDROCK_API_KEY: { + label: "Bedrock API Key (推荐)", + placeholder: "your-bedrock-api-key", + editorValue: "", + optional: true, + }, AWS_ACCESS_KEY_ID: { label: "Access Key ID", placeholder: "AKIA...", editorValue: "", + optional: true, }, AWS_SECRET_ACCESS_KEY: { label: "Secret Access Key", placeholder: "your-secret-key", editorValue: "", - }, - }, - icon: "aws", - iconColor: "#FF9900", - }, - { - name: "AWS Bedrock (API Key)", - websiteUrl: "https://aws.amazon.com/bedrock/", - apiKeyField: "ANTHROPIC_API_KEY", - settingsConfig: { - apiKey: "${BEDROCK_API_KEY}", - env: { - ANTHROPIC_BASE_URL: - "https://bedrock-runtime.${AWS_REGION}.amazonaws.com", - AWS_REGION: "${AWS_REGION}", - ANTHROPIC_MODEL: "global.anthropic.claude-opus-4-6-v1", - ANTHROPIC_DEFAULT_HAIKU_MODEL: - "global.anthropic.claude-haiku-4-5-20251001-v1:0", - ANTHROPIC_DEFAULT_SONNET_MODEL: - "global.anthropic.claude-sonnet-4-5-20250929-v1:0", - ANTHROPIC_DEFAULT_OPUS_MODEL: "global.anthropic.claude-opus-4-6-v1", - CLAUDE_CODE_USE_BEDROCK: "1", - }, - }, - category: "cloud_provider", - templateValues: { - AWS_REGION: { - label: "AWS Region", - placeholder: "us-west-2", - editorValue: "us-west-2", - }, - BEDROCK_API_KEY: { - label: "Bedrock API Key", - placeholder: "your-bedrock-api-key", - editorValue: "", + optional: true, + isSecret: true, }, }, icon: "aws",