mirror of
https://github.com/multipleof4/lynchmark.git
synced 2026-04-27 19:52:14 +00:00
Docs: Update benchmark for moonshotai/kimi-k2.6
This commit is contained in:
17
tests/8_json_validator/outputs/moonshotai_kimi-k2.6.js
Normal file
17
tests/8_json_validator/outputs/moonshotai_kimi-k2.6.js
Normal file
@@ -0,0 +1,17 @@
|
||||
let A;
|
||||
const validateJSON = async (json, schema) => {
|
||||
try {
|
||||
A ||= (await import('https://cdn.jsdelivr.net/npm/ajv@8.12.0/dist/ajv.mjs')).default;
|
||||
const v = new A({ allErrors: !0, strict: !1 }).compile(schema);
|
||||
const valid = v(json);
|
||||
return {
|
||||
valid,
|
||||
errors: valid ? [] : v.errors.map(e => `${e.instancePath || '/'} ${e.message}`.trim())
|
||||
};
|
||||
} catch (e) {
|
||||
return { valid: !1, errors: [e.message] };
|
||||
}
|
||||
};
|
||||
export default validateJSON;
|
||||
// Generation time: 65.490s
|
||||
// Result: FAIL
|
||||
Reference in New Issue
Block a user