fix(confidence-engine): supply synthesis output schema
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user