fix(confidence-engine): bound focused investigation input
This commit is contained in:
@@ -50,6 +50,23 @@ async function post(request) {
|
||||
);
|
||||
}
|
||||
|
||||
const REQUEST_LENGTH_LIMITS = {
|
||||
answer: 10000,
|
||||
question: 2048,
|
||||
centralStatement: 2048,
|
||||
targetLabel: 2048,
|
||||
targetDescription: 2048,
|
||||
};
|
||||
|
||||
for (const [field, limit] of Object.entries(REQUEST_LENGTH_LIMITS)) {
|
||||
if (body[field] && body[field].length > limit) {
|
||||
return Response.json(
|
||||
{ error: `Request field "${field}" exceeds maximum length of ${limit} characters` },
|
||||
{ status: 400 },
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const prompt = buildFocusedDeconstructPrompt({
|
||||
targetLabel: body.targetLabel,
|
||||
targetDescription: body.targetDescription,
|
||||
|
||||
Reference in New Issue
Block a user