fix(confidence-engine): supply synthesis output schema

This commit is contained in:
2026-09-07 13:44:57 +01:00
parent 3f2e2e05ae
commit 7548a6af59
3 changed files with 19 additions and 2 deletions
+11 -1
View File
@@ -186,6 +186,15 @@ export const synthesisResponseSchema = z.object({
.min(1, "currentUnderstanding must be a non-empty string"),
});
export const synthesisOutputSchema = {
type: "object",
properties: {
currentUnderstanding: { type: "string" },
},
required: ["currentUnderstanding"],
additionalProperties: false,
};
/** Validate raw provider output against synthesis response schema */
export function validateSynthesisResponse(raw) {
if (raw == null) {
@@ -274,7 +283,8 @@ export async function synthesizeCurrentUnderstanding(
try {
rawResponse = await provider.generateReconstruction(
prompt,
modelName
modelName,
synthesisOutputSchema,
);
} catch (error) {
const err = new Error(error.message ?? "Synthesis provider call failed");