| | without any CSS styling. STRICTLY AVOID any markdown table syntax.
`)
}).optional();
}
if (allowReflect) {
actionSchemas.reflect = z.object({
questionsToAnswer: z.array(
z.string().describe(`
Ensure each reflection question:
- Cuts to core emotional truths while staying anchored to
- Transforms surface-level problems into deeper psychological insights, helps answer
- Makes the unconscious conscious
- NEVER pose general questions like: "How can I verify the accuracy of information before including it in my answer?", "What information was actually contained in the URLs I found?", "How can i tell if a source is reliable?".
`)
).max(MAX_REFLECT_PER_STEP)
.describe(`Required when action='reflect'. Reflection and planing, generate a list of most important questions to fill the knowledge gaps to ${currentQuestion} . Maximum provide ${MAX_REFLECT_PER_STEP} reflect questions.`)
}).optional()
}
if (allowRead) {
actionSchemas.visit = z.object({
URLTargets: z.array(z.number())
.max(MAX_URLS_PER_STEP)
.describe(`Required when action='visit'. Must be the index of the URL in from the original list of URLs. Maximum ${MAX_URLS_PER_STEP} URLs allowed.`)
}).optional();
}
// Create an object with action as a string literal and exactly one action property
return z.object({
think: z.string().describe(`Concisely explain your reasoning process in ${this.getLanguagePrompt()}.`).max(500),
action: z.enum(Object.keys(actionSchemas).map(key => key) as [string, ...string[]])
.describe("Choose exactly one best action from the available actions, fill in the corresponding action schema required. Keep the reasons in mind: (1) What specific information is still needed? (2) Why is this action most likely to provide that information? (3) What alternatives did you consider and why were they rejected? (4) How will this action advance toward the complete answer?"),
...actionSchemas,
});
}
} |