mirror of
https://github.com/jina-ai/node-DeepResearch.git
synced 2025-12-26 06:28:56 +08:00
fix: url sanitization
This commit is contained in:
parent
47b9e436d5
commit
9f97d266de
@ -169,7 +169,7 @@ export class ObjectGeneratorSafe {
|
|||||||
// Create a distilled version of the schema without descriptions
|
// Create a distilled version of the schema without descriptions
|
||||||
const distilledSchema = this.createDistilledSchema(schema);
|
const distilledSchema = this.createDistilledSchema(schema);
|
||||||
// find last `"url":` appear in the string, which is the source of the problem
|
// find last `"url":` appear in the string, which is the source of the problem
|
||||||
const tailoredOutput = failedOutput.slice(0, Math.max(failedOutput.lastIndexOf('"url":'), 1500));
|
const tailoredOutput = failedOutput.slice(0, Math.min(failedOutput.lastIndexOf('"url":'), 5000));
|
||||||
|
|
||||||
const fallbackResult = await generateObject({
|
const fallbackResult = await generateObject({
|
||||||
model: fallbackModel,
|
model: fallbackModel,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user