mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-05-01 21:20:44 +00:00
perf(core): avoid recompiling schema on retry
This commit is contained in:
parent
0f3e97ea1c
commit
7b01b26ff5
1 changed files with 2 additions and 4 deletions
|
|
@ -41,14 +41,12 @@ export class SchemaValidator {
|
|||
return 'Value of params must be an object';
|
||||
}
|
||||
const validate = ajValidator.compile(schema);
|
||||
const valid = validate(data);
|
||||
let valid = validate(data);
|
||||
if (!valid && validate.errors) {
|
||||
// Coerce string boolean values ("true"/"false") to actual booleans
|
||||
fixBooleanValues(data as Record<string, unknown>);
|
||||
|
||||
const validate = ajValidator.compile(schema);
|
||||
const valid = validate(data);
|
||||
|
||||
valid = validate(data);
|
||||
if (!valid && validate.errors) {
|
||||
return ajValidator.errorsText(validate.errors, { dataVar: 'params' });
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue