fix(deep-research): context size in settings are not applied to trimPrompt
This commit is contained in:
@ -159,7 +159,7 @@ function processSearchResult({
|
|||||||
),
|
),
|
||||||
})
|
})
|
||||||
const jsonSchema = JSON.stringify(zodToJsonSchema(schema))
|
const jsonSchema = JSON.stringify(zodToJsonSchema(schema))
|
||||||
const contents = results.map((item) => trimPrompt(item.content, 25_000))
|
const contents = results.map((item) => trimPrompt(item.content))
|
||||||
const prompt = [
|
const prompt = [
|
||||||
`Given the following contents from a SERP search for the query <query>${query}</query>, generate a list of learnings from the contents. Return a maximum of ${numLearnings} learnings, but feel free to return less if the contents are clear. Make sure each learning is unique and not similar to each other. The learnings should be concise and to the point, as detailed and information dense as possible. Make sure to include any entities like people, places, companies, products, things, etc in the learnings, as well as any exact metrics, numbers, or dates. The learnings will be used to research the topic further.`,
|
`Given the following contents from a SERP search for the query <query>${query}</query>, generate a list of learnings from the contents. Return a maximum of ${numLearnings} learnings, but feel free to return less if the contents are clear. Make sure each learning is unique and not similar to each other. The learnings should be concise and to the point, as detailed and information dense as possible. Make sure to include any entities like people, places, companies, products, things, etc in the learnings, as well as any exact metrics, numbers, or dates. The learnings will be used to research the topic further.`,
|
||||||
`<contents>${contents
|
`<contents>${contents
|
||||||
@ -188,7 +188,6 @@ export function writeFinalReport({
|
|||||||
learnings
|
learnings
|
||||||
.map((learning) => `<learning>\n${learning}\n</learning>`)
|
.map((learning) => `<learning>\n${learning}\n</learning>`)
|
||||||
.join('\n'),
|
.join('\n'),
|
||||||
150_000,
|
|
||||||
)
|
)
|
||||||
const _prompt = [
|
const _prompt = [
|
||||||
`Given the following prompt from the user, write a final report on the topic using the learnings from research. Make it as as detailed as possible, aim for 3 or more pages, include ALL the learnings from research:`,
|
`Given the following prompt from the user, write a final report on the topic using the learnings from research. Make it as as detailed as possible, aim for 3 or more pages, include ALL the learnings from research:`,
|
||||||
|
Reference in New Issue
Block a user