feat: 完善模型能力识别与验证

- 自动识别模型类型、视觉、推理和工具能力并保留手动覆盖

- 使用 AgentScope 工具与视觉探测并统一管理端配置反馈
This commit is contained in:
2026-07-27 19:40:23 +08:00
parent 0dc5c3ca55
commit 567fd12706
21 changed files with 1059 additions and 378 deletions

View File

@@ -39,6 +39,22 @@ export async function verifyModelConfig(id: string) {
export type ModelCapabilitySource = 'CATALOG' | 'DEFAULT' | 'RULE';
export interface ModelCapabilityResolution {
detected: boolean;
modelType: 'chatModel' | 'embeddingModel' | 'rerankModel';
source: ModelCapabilitySource;
supportImage?: boolean | null;
supportThinking?: boolean | null;
supportTool?: boolean | null;
}
export async function resolveModelCapabilities(params: {
modelName: string;
providerId?: string;
}) {
return api.get('/api/v1/model/capabilities', { params });
}
export interface RemoteModelDescriptor {
addable: boolean;
added: boolean;
@@ -91,6 +107,7 @@ export interface ModelVerificationData {
nonStreaming?: ModelVerificationStageStatus;
status?: ModelVerificationStageStatus;
streaming?: ModelVerificationStageStatus;
supportTool?: boolean;
}
export interface ModelInvokeConfigPayload {
@@ -136,8 +153,9 @@ export interface llmType {
groupName: string;
invokeCode?: string;
publishEnabled?: boolean;
supportTool?: boolean;
supportImage?: boolean;
supportThinking?: boolean | null;
supportTool?: boolean | null;
supportImage?: boolean | null;
supportImageB64Only?: boolean;
supportToolMessage?: boolean;
added: boolean;