mirror of
https://github.com/multipleof4/lynchmark.git
synced 2026-01-14 00:27:55 +00:00
Docs: Update benchmark for anthropic/claude-opus-4.5 TEMP:0.7
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
async function validateJSON(jsonObject, jsonSchema) {
|
||||
const { default: Ajv } = await import("https://esm.sh/ajv@8");
|
||||
const { default: addFormats } = await import("https://esm.sh/ajv-formats@3");
|
||||
|
||||
const ajv = new Ajv({ allErrors: true, strict: false });
|
||||
addFormats(ajv);
|
||||
|
||||
const validate = ajv.compile(jsonSchema);
|
||||
const valid = validate(jsonObject);
|
||||
|
||||
return {
|
||||
valid,
|
||||
errors: valid ? [] : validate.errors.map(e =>
|
||||
e.instancePath ? `${e.instancePath} ${e.message}` : e.message
|
||||
)
|
||||
};
|
||||
}
|
||||
export default validateJSON;
|
||||
Reference in New Issue
Block a user