mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-06-12 18:08:54 +00:00
Add virtual model support for multi-key expansion
Virtual models generated from multi-key expansion are now marked and filtered during config persistence. Virtual models display with a badge in the UI and cannot be set as default.
This commit is contained in:
@@ -21,6 +21,7 @@ export interface ModelInfo {
|
||||
// Meta
|
||||
configured: boolean
|
||||
is_default: boolean
|
||||
is_virtual: boolean
|
||||
}
|
||||
|
||||
interface ModelsListResponse {
|
||||
|
||||
@@ -28,7 +28,7 @@ export function ModelCard({
|
||||
}: ModelCardProps) {
|
||||
const { t } = useTranslation()
|
||||
const isOAuth = model.auth_method === "oauth"
|
||||
const canSetDefault = model.configured && !model.is_default
|
||||
const canSetDefault = model.configured && !model.is_default && !model.is_virtual
|
||||
|
||||
return (
|
||||
<div
|
||||
@@ -64,6 +64,11 @@ export function ModelCard({
|
||||
{t("models.badge.default")}
|
||||
</span>
|
||||
)}
|
||||
{model.is_virtual && (
|
||||
<span className="bg-muted text-muted-foreground shrink-0 rounded px-1.5 py-0.5 text-[10px] leading-none font-medium">
|
||||
{t("models.badge.virtual")}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="flex shrink-0 items-center gap-0.5">
|
||||
|
||||
@@ -154,7 +154,8 @@
|
||||
"unconfigured": "Not configured"
|
||||
},
|
||||
"badge": {
|
||||
"default": "Default"
|
||||
"default": "Default",
|
||||
"virtual": "Virtual"
|
||||
},
|
||||
"action": {
|
||||
"edit": "Edit API key",
|
||||
|
||||
@@ -154,7 +154,8 @@
|
||||
"unconfigured": "未配置"
|
||||
},
|
||||
"badge": {
|
||||
"default": "默认"
|
||||
"default": "默认",
|
||||
"virtual": "虚拟"
|
||||
},
|
||||
"action": {
|
||||
"edit": "编辑 API Key",
|
||||
|
||||
Reference in New Issue
Block a user