fix(feedback): force the AI model to generate x questions instead of "max x"
This commit is contained in:
@ -21,13 +21,11 @@ export function generateFeedback({
|
||||
const schema = z.object({
|
||||
questions: z
|
||||
.array(z.string())
|
||||
.describe(
|
||||
`Follow up questions to clarify the research direction, max of ${numQuestions}`,
|
||||
),
|
||||
.describe(`Follow up questions to clarify the research direction`),
|
||||
})
|
||||
const jsonSchema = JSON.stringify(zodToJsonSchema(schema))
|
||||
const prompt = [
|
||||
`Given the following query from the user, ask some follow up questions to clarify the research direction. Return a maximum of ${numQuestions} questions, but feel free to return less if the original query is clear: <query>${query}</query>`,
|
||||
`Given the following query from the user, ask ${numQuestions} follow up questions to clarify the research direction. Return a maximum of ${numQuestions} questions, but feel free to return less if the original query is clear: <query>${query}</query>`,
|
||||
`You MUST respond in JSON with the following schema: ${jsonSchema}`,
|
||||
].join('\n\n')
|
||||
|
||||
|
Reference in New Issue
Block a user