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

@@ -19,12 +19,9 @@ interface ModelVerificationResponse {
message?: string;
}
const STREAMING_UNAVAILABLE_MESSAGE =
'连接成功,流式响应不可用,可关闭智能体的模型流式响应。';
export function resolveModelVerificationFeedback(
response: ModelVerificationResponse,
modelType: string,
_modelType: string,
): ModelVerificationFeedback {
if (response.errorCode !== 0) {
return {
@@ -33,13 +30,6 @@ export function resolveModelVerificationFeedback(
};
}
if (response.data?.status === 'PARTIAL') {
return {
message: response.data.message || STREAMING_UNAVAILABLE_MESSAGE,
status: 'warning',
};
}
if (response.data?.status === 'FAILED') {
return {
message: response.data.message || '验证失败',
@@ -50,10 +40,7 @@ export function resolveModelVerificationFeedback(
const dimension = response.data?.dimension;
return {
dimension,
message:
modelType === 'embeddingModel' && dimension
? `验证成功,向量维度:${dimension}`
: response.data?.message || '验证成功',
message: '验证通过',
status: 'success',
};
}
@@ -63,10 +50,10 @@ export function getVerifyButtonText(status: VerifyButtonStatus): string {
return '验证中';
}
if (status === 'success') {
return '验证成功';
return '验证通过';
}
if (status === 'warning') {
return '流式不可用';
return '验证通过';
}
if (status === 'error') {
return '验证失败';