Files
moyi-model-intelligence-hub/prototype/src/types.ts
T

109 lines
2.2 KiB
TypeScript

import type { Component } from 'vue'
export type Portal = 'user' | 'admin'
export type ModelType = '文本' | '多模态' | '图像' | '3D' | '视频' | '音频'
export type CallMode = '同步' | '流式' | '异步'
export type TaskStatus = '排队中' | '执行中' | '已完成' | '失败'
export interface NavItem {
id: string
label: string
icon: Component
badge?: string
}
export interface NavGroup {
label: string
items: NavItem[]
}
export interface ModelItem {
id: string
name: string
provider: string
type: ModelType
mode: CallMode
description: string
latency: string
specification: string
availability: string
accent: string
icon: Component
modelKey?: string
sourceLabel?: string
pricing?: { input?: number; output?: number; unit?: string }
priority?: number
maxConcurrency?: number
}
export interface ApiKeyItem {
id: string | number
name: string
value: string
scope: string
scopeType?: 'personal' | 'project'
projectId?: string
modelIds: string[]
createdAt: string
lastUsed: string
status: '正常' | '已停用'
}
export interface TaskItem {
id: string
name: string
model: string
status: TaskStatus
progress: number
createdAt: string
duration: string
result: string
provider?: string
prompt?: string
modelUrl?: string
videoUrl?: string
previewUrl?: string
creditsConsumed?: number
remote?: boolean
}
export interface AdminUser {
id: string
name: string
email: string
role: string
balance?: number
usage?: string
lastActive?: string
status: '正常' | '待激活' | '已停用'
}
export interface ProviderItem {
id: string
name: string
capability: string
models: number
latency: string
successRate: string
status: '健康' | '波动' | '维护中'
enabled: boolean
code?: string
protocol?: 'openai-compatible' | 'http' | 'sdk'
sourceType?: 'official' | 'relay' | 'self-hosted' | 'custom'
baseUrl?: string
description?: string
credentialType?: 'none' | 'api-key' | 'bearer' | 'access-token'
credentialMasked?: string
}
export interface RouteItem {
id: string
model: string
capability: string
primary: string
fallback: string
policy: string
health: string
enabled: boolean
}