fix(ai): 测试连接改为结构化结果,不再倾倒模型原始回复
返回 {model, latencyMs, tokensUsed, replyLength};前端提示「连接正常:模型 · 耗时 · tokens」。
模型原始回复不回传——测试要的是通没通/多快,不是看模型说了什么(ECHO 假模型下尤其明显)。
空回复时明确报错提示检查 baseURL 是否 OpenAI 兼容。
This commit is contained in:
1 parent
f1d9480caf
commit
5d898e3592
6 files changed
+30
-11
No files matched your search
@@ -207,7 +207,7 @@ export default function AiopsPage() {
|
||||
model: config?.model,
|
||||
apiKey: apiKeyInput.trim() || undefined,
|
||||
})
|
||||
toast.success(t('config.testOk', { reply: res.reply || 'OK' }))
|
||||
toast.success(t('config.testOk', { model: res.model, latency: (res.latencyMs / 1000).toFixed(1), tokens: res.tokensUsed }))
|
||||
} catch (err) {
|
||||
toast.error(err instanceof Error ? err.message : '连接失败')
|
||||
} finally {
|
||||
|
||||
Reference in new issue
Block a user