feat(confidence-engine): constrain reconstruction chat output

This commit is contained in:
2026-09-05 18:44:47 +01:00
parent 8c5b47bcf5
commit c7a0a79d0f
3 changed files with 20 additions and 3 deletions
+11
View File
@@ -23,6 +23,17 @@ describe("OllamaLlmProvider chat capability detection", () => {
expect(fetchSpy.mock.calls[0][0]).toBe("http://ollama.test/api/chat");
expect(fetchSpy.mock.calls[1][0]).toBe("http://ollama.test/api/chat");
expect(fetchSpy.mock.calls[1][0]).not.toContain("/api/generate");
const chatRequest = JSON.parse(fetchSpy.mock.calls[1][1].body);
expect(chatRequest).toMatchObject({
model: "configured-model",
messages: [{ role: "user", content: "prompt" }],
stream: false,
});
expect(chatRequest.format).toBeTypeOf("object");
expect(chatRequest.format).not.toBe("json");
const formatText = JSON.stringify(chatRequest.format);
expect(formatText).toContain("relationship");
expect(formatText).toContain("evidenceType");
expect(result).toMatchObject({
response: {},
providerApiPath: "/api/chat",