fix(confidence-engine): use configured model for chat detection

This commit is contained in:
2026-09-05 16:46:24 +01:00
parent 8c3edfec7d
commit 677f5e5757
3 changed files with 40 additions and 3 deletions
+3 -3
View File
@@ -60,7 +60,7 @@ function recoverJson(raw) {
let _chatSupported = null;
async function detectChatSupport(baseUrl) {
async function detectChatSupport(baseUrl, modelName) {
if (_chatSupported !== null) return _chatSupported;
try {
@@ -68,7 +68,7 @@ async function detectChatSupport(baseUrl) {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
model: "dummy-check",
model: modelName,
messages: [{ role: "user", content: "test" }],
stream: false,
}),
@@ -109,7 +109,7 @@ class OllamaLlmProvider {
// Step 1: Detect whether /api/chat exists (cache result)
// ================================================================
try {
chatSupported = await detectChatSupport(baseUrl);
chatSupported = await detectChatSupport(baseUrl, modelName);
} catch { /* failed silently — defaults to false */ }
// ================================================================