mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-24 12:44:18 +08:00
feat: add model role badges and reorder presets to prioritize Opus
- Add Primary/Fallback badge to each model card in OpenClaw form - Update modelsHint to explain model ordering semantics - Reorder 11 aggregator/third-party presets to put Opus first
This commit is contained in:
@@ -236,6 +236,24 @@ export function OpenClawFormFields({
|
||||
key={modelKeys[index]}
|
||||
className="p-3 border border-border/50 rounded-lg space-y-3"
|
||||
>
|
||||
{/* Role badge */}
|
||||
<div className="flex items-center">
|
||||
<span
|
||||
className={`text-[10px] font-medium px-1.5 py-0.5 rounded ${
|
||||
index === 0
|
||||
? "bg-blue-500/15 text-blue-600 dark:text-blue-400"
|
||||
: "bg-muted text-muted-foreground"
|
||||
}`}
|
||||
>
|
||||
{index === 0
|
||||
? t("openclaw.primaryModel", {
|
||||
defaultValue: "默认模型",
|
||||
})
|
||||
: t("openclaw.fallbackModel", {
|
||||
defaultValue: "回退模型",
|
||||
})}
|
||||
</span>
|
||||
</div>
|
||||
{/* Model ID and Name row */}
|
||||
<div className="flex items-center gap-2">
|
||||
<div className="flex-1 space-y-1">
|
||||
@@ -463,7 +481,7 @@ export function OpenClawFormFields({
|
||||
<p className="text-xs text-muted-foreground">
|
||||
{t("openclaw.modelsHint", {
|
||||
defaultValue:
|
||||
"配置该供应商支持的模型。模型 ID 用于 API 调用,显示名称用于界面展示。",
|
||||
"配置该供应商支持的模型。第一个模型为默认模型(Primary),其余为回退模型(Fallback)。拖拽或调整顺序可更改默认模型。",
|
||||
})}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -557,18 +557,18 @@ export const openclawProviderPresets: OpenClawProviderPreset[] = [
|
||||
apiKey: "",
|
||||
api: "anthropic-messages",
|
||||
models: [
|
||||
{
|
||||
id: "claude-sonnet-4-6",
|
||||
name: "Claude Sonnet 4.6",
|
||||
contextWindow: 200000,
|
||||
cost: { input: 3, output: 15 },
|
||||
},
|
||||
{
|
||||
id: "claude-opus-4-6",
|
||||
name: "Claude Opus 4.6",
|
||||
contextWindow: 200000,
|
||||
cost: { input: 5, output: 25 },
|
||||
},
|
||||
{
|
||||
id: "claude-sonnet-4-6",
|
||||
name: "Claude Sonnet 4.6",
|
||||
contextWindow: 200000,
|
||||
cost: { input: 3, output: 15 },
|
||||
},
|
||||
],
|
||||
},
|
||||
category: "aggregator",
|
||||
@@ -583,12 +583,12 @@ export const openclawProviderPresets: OpenClawProviderPreset[] = [
|
||||
},
|
||||
suggestedDefaults: {
|
||||
model: {
|
||||
primary: "aihubmix/claude-sonnet-4-6",
|
||||
fallbacks: ["aihubmix/claude-opus-4-6"],
|
||||
primary: "aihubmix/claude-opus-4-6",
|
||||
fallbacks: ["aihubmix/claude-sonnet-4-6"],
|
||||
},
|
||||
modelCatalog: {
|
||||
"aihubmix/claude-sonnet-4-6": { alias: "Sonnet" },
|
||||
"aihubmix/claude-opus-4-6": { alias: "Opus" },
|
||||
"aihubmix/claude-sonnet-4-6": { alias: "Sonnet" },
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -601,18 +601,18 @@ export const openclawProviderPresets: OpenClawProviderPreset[] = [
|
||||
apiKey: "",
|
||||
api: "anthropic-messages",
|
||||
models: [
|
||||
{
|
||||
id: "claude-sonnet-4-6",
|
||||
name: "Claude Sonnet 4.6",
|
||||
contextWindow: 200000,
|
||||
cost: { input: 3, output: 15 },
|
||||
},
|
||||
{
|
||||
id: "claude-opus-4-6",
|
||||
name: "Claude Opus 4.6",
|
||||
contextWindow: 200000,
|
||||
cost: { input: 5, output: 25 },
|
||||
},
|
||||
{
|
||||
id: "claude-sonnet-4-6",
|
||||
name: "Claude Sonnet 4.6",
|
||||
contextWindow: 200000,
|
||||
cost: { input: 3, output: 15 },
|
||||
},
|
||||
],
|
||||
},
|
||||
category: "aggregator",
|
||||
@@ -627,12 +627,12 @@ export const openclawProviderPresets: OpenClawProviderPreset[] = [
|
||||
},
|
||||
suggestedDefaults: {
|
||||
model: {
|
||||
primary: "dmxapi/claude-sonnet-4-6",
|
||||
fallbacks: ["dmxapi/claude-opus-4-6"],
|
||||
primary: "dmxapi/claude-opus-4-6",
|
||||
fallbacks: ["dmxapi/claude-sonnet-4-6"],
|
||||
},
|
||||
modelCatalog: {
|
||||
"dmxapi/claude-sonnet-4-6": { alias: "Sonnet" },
|
||||
"dmxapi/claude-opus-4-6": { alias: "Opus" },
|
||||
"dmxapi/claude-sonnet-4-6": { alias: "Sonnet" },
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -645,18 +645,18 @@ export const openclawProviderPresets: OpenClawProviderPreset[] = [
|
||||
apiKey: "",
|
||||
api: "openai-completions",
|
||||
models: [
|
||||
{
|
||||
id: "anthropic/claude-sonnet-4.6",
|
||||
name: "Claude Sonnet 4.6",
|
||||
contextWindow: 200000,
|
||||
cost: { input: 3, output: 15 },
|
||||
},
|
||||
{
|
||||
id: "anthropic/claude-opus-4.6",
|
||||
name: "Claude Opus 4.6",
|
||||
contextWindow: 200000,
|
||||
cost: { input: 5, output: 25 },
|
||||
},
|
||||
{
|
||||
id: "anthropic/claude-sonnet-4.6",
|
||||
name: "Claude Sonnet 4.6",
|
||||
contextWindow: 200000,
|
||||
cost: { input: 3, output: 15 },
|
||||
},
|
||||
],
|
||||
},
|
||||
category: "aggregator",
|
||||
@@ -671,12 +671,12 @@ export const openclawProviderPresets: OpenClawProviderPreset[] = [
|
||||
},
|
||||
suggestedDefaults: {
|
||||
model: {
|
||||
primary: "openrouter/anthropic/claude-sonnet-4.6",
|
||||
fallbacks: ["openrouter/anthropic/claude-opus-4.6"],
|
||||
primary: "openrouter/anthropic/claude-opus-4.6",
|
||||
fallbacks: ["openrouter/anthropic/claude-sonnet-4.6"],
|
||||
},
|
||||
modelCatalog: {
|
||||
"openrouter/anthropic/claude-sonnet-4.6": { alias: "Sonnet" },
|
||||
"openrouter/anthropic/claude-opus-4.6": { alias: "Opus" },
|
||||
"openrouter/anthropic/claude-sonnet-4.6": { alias: "Sonnet" },
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -863,18 +863,18 @@ export const openclawProviderPresets: OpenClawProviderPreset[] = [
|
||||
apiKey: "",
|
||||
api: "anthropic-messages",
|
||||
models: [
|
||||
{
|
||||
id: "claude-sonnet-4-6",
|
||||
name: "Claude Sonnet 4.6",
|
||||
contextWindow: 200000,
|
||||
cost: { input: 3, output: 15 },
|
||||
},
|
||||
{
|
||||
id: "claude-opus-4-6",
|
||||
name: "Claude Opus 4.6",
|
||||
contextWindow: 200000,
|
||||
cost: { input: 5, output: 25 },
|
||||
},
|
||||
{
|
||||
id: "claude-sonnet-4-6",
|
||||
name: "Claude Sonnet 4.6",
|
||||
contextWindow: 200000,
|
||||
cost: { input: 3, output: 15 },
|
||||
},
|
||||
],
|
||||
},
|
||||
category: "third_party",
|
||||
@@ -890,12 +890,12 @@ export const openclawProviderPresets: OpenClawProviderPreset[] = [
|
||||
},
|
||||
suggestedDefaults: {
|
||||
model: {
|
||||
primary: "packycode/claude-sonnet-4-6",
|
||||
fallbacks: ["packycode/claude-opus-4-6"],
|
||||
primary: "packycode/claude-opus-4-6",
|
||||
fallbacks: ["packycode/claude-sonnet-4-6"],
|
||||
},
|
||||
modelCatalog: {
|
||||
"packycode/claude-sonnet-4-6": { alias: "Sonnet" },
|
||||
"packycode/claude-opus-4-6": { alias: "Opus" },
|
||||
"packycode/claude-sonnet-4-6": { alias: "Sonnet" },
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -908,18 +908,18 @@ export const openclawProviderPresets: OpenClawProviderPreset[] = [
|
||||
apiKey: "",
|
||||
api: "anthropic-messages",
|
||||
models: [
|
||||
{
|
||||
id: "claude-sonnet-4-6",
|
||||
name: "Claude Sonnet 4.6",
|
||||
contextWindow: 200000,
|
||||
cost: { input: 3, output: 15 },
|
||||
},
|
||||
{
|
||||
id: "claude-opus-4-6",
|
||||
name: "Claude Opus 4.6",
|
||||
contextWindow: 200000,
|
||||
cost: { input: 5, output: 25 },
|
||||
},
|
||||
{
|
||||
id: "claude-sonnet-4-6",
|
||||
name: "Claude Sonnet 4.6",
|
||||
contextWindow: 200000,
|
||||
cost: { input: 3, output: 15 },
|
||||
},
|
||||
],
|
||||
},
|
||||
category: "third_party",
|
||||
@@ -936,12 +936,12 @@ export const openclawProviderPresets: OpenClawProviderPreset[] = [
|
||||
},
|
||||
suggestedDefaults: {
|
||||
model: {
|
||||
primary: "cubence/claude-sonnet-4-6",
|
||||
fallbacks: ["cubence/claude-opus-4-6"],
|
||||
primary: "cubence/claude-opus-4-6",
|
||||
fallbacks: ["cubence/claude-sonnet-4-6"],
|
||||
},
|
||||
modelCatalog: {
|
||||
"cubence/claude-sonnet-4-6": { alias: "Sonnet" },
|
||||
"cubence/claude-opus-4-6": { alias: "Opus" },
|
||||
"cubence/claude-sonnet-4-6": { alias: "Sonnet" },
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -954,18 +954,18 @@ export const openclawProviderPresets: OpenClawProviderPreset[] = [
|
||||
apiKey: "",
|
||||
api: "anthropic-messages",
|
||||
models: [
|
||||
{
|
||||
id: "claude-sonnet-4-6",
|
||||
name: "Claude Sonnet 4.6",
|
||||
contextWindow: 200000,
|
||||
cost: { input: 3, output: 15 },
|
||||
},
|
||||
{
|
||||
id: "claude-opus-4-6",
|
||||
name: "Claude Opus 4.6",
|
||||
contextWindow: 200000,
|
||||
cost: { input: 5, output: 25 },
|
||||
},
|
||||
{
|
||||
id: "claude-sonnet-4-6",
|
||||
name: "Claude Sonnet 4.6",
|
||||
contextWindow: 200000,
|
||||
cost: { input: 3, output: 15 },
|
||||
},
|
||||
],
|
||||
},
|
||||
category: "third_party",
|
||||
@@ -982,12 +982,12 @@ export const openclawProviderPresets: OpenClawProviderPreset[] = [
|
||||
},
|
||||
suggestedDefaults: {
|
||||
model: {
|
||||
primary: "aigocode/claude-sonnet-4-6",
|
||||
fallbacks: ["aigocode/claude-opus-4-6"],
|
||||
primary: "aigocode/claude-opus-4-6",
|
||||
fallbacks: ["aigocode/claude-sonnet-4-6"],
|
||||
},
|
||||
modelCatalog: {
|
||||
"aigocode/claude-sonnet-4-6": { alias: "Sonnet" },
|
||||
"aigocode/claude-opus-4-6": { alias: "Opus" },
|
||||
"aigocode/claude-sonnet-4-6": { alias: "Sonnet" },
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -1000,18 +1000,18 @@ export const openclawProviderPresets: OpenClawProviderPreset[] = [
|
||||
apiKey: "",
|
||||
api: "anthropic-messages",
|
||||
models: [
|
||||
{
|
||||
id: "claude-sonnet-4-6",
|
||||
name: "Claude Sonnet 4.6",
|
||||
contextWindow: 200000,
|
||||
cost: { input: 3, output: 15 },
|
||||
},
|
||||
{
|
||||
id: "claude-opus-4-6",
|
||||
name: "Claude Opus 4.6",
|
||||
contextWindow: 200000,
|
||||
cost: { input: 5, output: 25 },
|
||||
},
|
||||
{
|
||||
id: "claude-sonnet-4-6",
|
||||
name: "Claude Sonnet 4.6",
|
||||
contextWindow: 200000,
|
||||
cost: { input: 3, output: 15 },
|
||||
},
|
||||
],
|
||||
},
|
||||
category: "third_party",
|
||||
@@ -1028,12 +1028,12 @@ export const openclawProviderPresets: OpenClawProviderPreset[] = [
|
||||
},
|
||||
suggestedDefaults: {
|
||||
model: {
|
||||
primary: "rightcode/claude-sonnet-4-6",
|
||||
fallbacks: ["rightcode/claude-opus-4-6"],
|
||||
primary: "rightcode/claude-opus-4-6",
|
||||
fallbacks: ["rightcode/claude-sonnet-4-6"],
|
||||
},
|
||||
modelCatalog: {
|
||||
"rightcode/claude-sonnet-4-6": { alias: "Sonnet" },
|
||||
"rightcode/claude-opus-4-6": { alias: "Opus" },
|
||||
"rightcode/claude-sonnet-4-6": { alias: "Sonnet" },
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -1046,18 +1046,18 @@ export const openclawProviderPresets: OpenClawProviderPreset[] = [
|
||||
apiKey: "",
|
||||
api: "anthropic-messages",
|
||||
models: [
|
||||
{
|
||||
id: "claude-sonnet-4-6",
|
||||
name: "Claude Sonnet 4.6",
|
||||
contextWindow: 200000,
|
||||
cost: { input: 3, output: 15 },
|
||||
},
|
||||
{
|
||||
id: "claude-opus-4-6",
|
||||
name: "Claude Opus 4.6",
|
||||
contextWindow: 200000,
|
||||
cost: { input: 5, output: 25 },
|
||||
},
|
||||
{
|
||||
id: "claude-sonnet-4-6",
|
||||
name: "Claude Sonnet 4.6",
|
||||
contextWindow: 200000,
|
||||
cost: { input: 3, output: 15 },
|
||||
},
|
||||
],
|
||||
},
|
||||
category: "third_party",
|
||||
@@ -1074,12 +1074,12 @@ export const openclawProviderPresets: OpenClawProviderPreset[] = [
|
||||
},
|
||||
suggestedDefaults: {
|
||||
model: {
|
||||
primary: "aicodemirror/claude-sonnet-4-6",
|
||||
fallbacks: ["aicodemirror/claude-opus-4-6"],
|
||||
primary: "aicodemirror/claude-opus-4-6",
|
||||
fallbacks: ["aicodemirror/claude-sonnet-4-6"],
|
||||
},
|
||||
modelCatalog: {
|
||||
"aicodemirror/claude-sonnet-4-6": { alias: "Sonnet" },
|
||||
"aicodemirror/claude-opus-4-6": { alias: "Opus" },
|
||||
"aicodemirror/claude-sonnet-4-6": { alias: "Sonnet" },
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -1092,18 +1092,18 @@ export const openclawProviderPresets: OpenClawProviderPreset[] = [
|
||||
apiKey: "",
|
||||
api: "anthropic-messages",
|
||||
models: [
|
||||
{
|
||||
id: "claude-sonnet-4-6",
|
||||
name: "Claude Sonnet 4.6",
|
||||
contextWindow: 200000,
|
||||
cost: { input: 3, output: 15 },
|
||||
},
|
||||
{
|
||||
id: "claude-opus-4-6",
|
||||
name: "Claude Opus 4.6",
|
||||
contextWindow: 200000,
|
||||
cost: { input: 5, output: 25 },
|
||||
},
|
||||
{
|
||||
id: "claude-sonnet-4-6",
|
||||
name: "Claude Sonnet 4.6",
|
||||
contextWindow: 200000,
|
||||
cost: { input: 3, output: 15 },
|
||||
},
|
||||
],
|
||||
},
|
||||
category: "third_party",
|
||||
@@ -1120,12 +1120,12 @@ export const openclawProviderPresets: OpenClawProviderPreset[] = [
|
||||
},
|
||||
suggestedDefaults: {
|
||||
model: {
|
||||
primary: "aicoding/claude-sonnet-4-6",
|
||||
fallbacks: ["aicoding/claude-opus-4-6"],
|
||||
primary: "aicoding/claude-opus-4-6",
|
||||
fallbacks: ["aicoding/claude-sonnet-4-6"],
|
||||
},
|
||||
modelCatalog: {
|
||||
"aicoding/claude-sonnet-4-6": { alias: "Sonnet" },
|
||||
"aicoding/claude-opus-4-6": { alias: "Opus" },
|
||||
"aicoding/claude-sonnet-4-6": { alias: "Sonnet" },
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -1138,18 +1138,18 @@ export const openclawProviderPresets: OpenClawProviderPreset[] = [
|
||||
apiKey: "",
|
||||
api: "anthropic-messages",
|
||||
models: [
|
||||
{
|
||||
id: "claude-sonnet-4-6",
|
||||
name: "Claude Sonnet 4.6",
|
||||
contextWindow: 200000,
|
||||
cost: { input: 3, output: 15 },
|
||||
},
|
||||
{
|
||||
id: "claude-opus-4-6",
|
||||
name: "Claude Opus 4.6",
|
||||
contextWindow: 200000,
|
||||
cost: { input: 5, output: 25 },
|
||||
},
|
||||
{
|
||||
id: "claude-sonnet-4-6",
|
||||
name: "Claude Sonnet 4.6",
|
||||
contextWindow: 200000,
|
||||
cost: { input: 3, output: 15 },
|
||||
},
|
||||
],
|
||||
},
|
||||
category: "third_party",
|
||||
@@ -1166,12 +1166,12 @@ export const openclawProviderPresets: OpenClawProviderPreset[] = [
|
||||
},
|
||||
suggestedDefaults: {
|
||||
model: {
|
||||
primary: "crazyrouter/claude-sonnet-4-6",
|
||||
fallbacks: ["crazyrouter/claude-opus-4-6"],
|
||||
primary: "crazyrouter/claude-opus-4-6",
|
||||
fallbacks: ["crazyrouter/claude-sonnet-4-6"],
|
||||
},
|
||||
modelCatalog: {
|
||||
"crazyrouter/claude-sonnet-4-6": { alias: "Sonnet" },
|
||||
"crazyrouter/claude-opus-4-6": { alias: "Opus" },
|
||||
"crazyrouter/claude-sonnet-4-6": { alias: "Sonnet" },
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -1184,18 +1184,18 @@ export const openclawProviderPresets: OpenClawProviderPreset[] = [
|
||||
apiKey: "",
|
||||
api: "anthropic-messages",
|
||||
models: [
|
||||
{
|
||||
id: "claude-sonnet-4-6",
|
||||
name: "Claude Sonnet 4.6",
|
||||
contextWindow: 200000,
|
||||
cost: { input: 3, output: 15 },
|
||||
},
|
||||
{
|
||||
id: "claude-opus-4-6",
|
||||
name: "Claude Opus 4.6",
|
||||
contextWindow: 200000,
|
||||
cost: { input: 5, output: 25 },
|
||||
},
|
||||
{
|
||||
id: "claude-sonnet-4-6",
|
||||
name: "Claude Sonnet 4.6",
|
||||
contextWindow: 200000,
|
||||
cost: { input: 3, output: 15 },
|
||||
},
|
||||
],
|
||||
},
|
||||
category: "third_party",
|
||||
@@ -1212,12 +1212,12 @@ export const openclawProviderPresets: OpenClawProviderPreset[] = [
|
||||
},
|
||||
suggestedDefaults: {
|
||||
model: {
|
||||
primary: "sssaicode/claude-sonnet-4-6",
|
||||
fallbacks: ["sssaicode/claude-opus-4-6"],
|
||||
primary: "sssaicode/claude-opus-4-6",
|
||||
fallbacks: ["sssaicode/claude-sonnet-4-6"],
|
||||
},
|
||||
modelCatalog: {
|
||||
"sssaicode/claude-sonnet-4-6": { alias: "Sonnet" },
|
||||
"sssaicode/claude-opus-4-6": { alias: "Opus" },
|
||||
"sssaicode/claude-sonnet-4-6": { alias: "Sonnet" },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user