fix: url sanitization

This commit is contained in:
Han Xiao 2025-03-17 21:33:58 +08:00
parent 9f97d266de
commit 85435a903f

View File

@ -169,7 +169,7 @@ export class ObjectGeneratorSafe {
// Create a distilled version of the schema without descriptions
const distilledSchema = this.createDistilledSchema(schema);
// find last `"url":` appear in the string, which is the source of the problem
const tailoredOutput = failedOutput.slice(0, Math.min(failedOutput.lastIndexOf('"url":'), 5000));
const tailoredOutput = failedOutput.slice(0, Math.min(failedOutput.lastIndexOf('"url":'), 8000));
const fallbackResult = await generateObject({
model: fallbackModel,