import { Ref } from 'vue'; import { UnifiedModelConfig } from '../types/model-config'; /** * 统一的模型管理 composable * 提供模型选择和配置管理功能 * @param modelConfigs 外部传入的模型配置列表(必需) * @param initialModelId 初始模型 ID(可选,从外部传入,支持 Ref) * @param onModelChange 模型变化回调函数(可选,用于通知外部) */ export default function useModel(modelConfigs?: Ref | UnifiedModelConfig[], initialModelId?: Ref | Ref | string, onModelChange?: (modelId: string) => void): { /** 当前选中的模型 ID Current selected model ID */ selectedModelId: Ref; /** 当前选中的完整模型配置 Current selected model configuration */ selectedModel: import('vue').ComputedRef; /** 所有可用的模型配置列表 All available model configurations */ availableModels: import('vue').ComputedRef; /** 设置选中的模型 Set selected model */ setSelectedModel: (modelId: string) => void; };