mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-04-15 07:42:28 +08:00
feat: extend TemplateValueConfig and merge Bedrock presets
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user