feat(models): add model test debugger for saved model configs

Let admins send real requests against configured chat, embedding, rerank,
VLM, and ASR models from settings, with thinking controls shown only when
the model supports them.
This commit is contained in:
wizardchen
2026-06-25 16:55:17 +08:00
committed by lyingbug
parent 122408b283
commit 2c44a41f2a
14 changed files with 1438 additions and 7 deletions
+18
View File
@@ -69,3 +69,21 @@ export function resolveThinkingControl(
}
return defaultThinkingControl(provider, modelName)
}
/** Whether the debug drawer should expose Think on/off for this saved model. */
export function modelSupportsThinking(model: {
type: string
source: string
name: string
parameters: {
provider?: string
extra_config?: { thinking_control?: string }
}
}): boolean {
if (model.type !== 'KnowledgeQA' || model.source !== 'remote') return false
return resolveThinkingControl(
model.parameters.extra_config?.thinking_control,
model.parameters.provider || '',
model.name || '',
) !== 'none'
}