mirror of
https://github.com/stack-auth/stack.git
synced 2026-07-20 21:29:36 +08:00
fix(backend): default improvementSuggestions to avoid false QA failures
Review of the structured-output change found that requiring improvementSuggestions reintroduced the failure-row problem: for good answers with nothing to suggest, the model omits the field, which would throw NoObjectGeneratedError and store a false 'needs human review' verdict. Verified live: the model omits it ~5/6 of the time on clean answers. Default it to "" so omission is tolerated, matching the old code's lenient handling.
This commit is contained in:
parent
ef9b4034cc
commit
72ae71017f
@ -40,7 +40,9 @@ const qaReviewSchema = z.object({
|
||||
severity: z.string(),
|
||||
explanation: z.string(),
|
||||
})),
|
||||
improvementSuggestions: z.string(),
|
||||
// Optional in practice: the model omits this for good answers with nothing to suggest.
|
||||
// Defaulting (rather than requiring) avoids turning those into structured-output failures.
|
||||
improvementSuggestions: z.string().default(""),
|
||||
overallScore: z.number(),
|
||||
});
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user