generator-begcode
Version:
Spring Boot + Angular/React/Vue in one handy generator
19 lines (18 loc) • 929 B
JavaScript
export const prompts = (onGoalAchievedFn, onGoalFailedFn) => ({
name: 'GoalVerifier',
expertise: "verifies if the users' goal has been achieved or not.",
initialMessages: () => [],
runMessages: ({ messagesToVerify }) => [
{
role: 'user',
content: `\`\`\`
${(messagesToVerify ?? []).map(x => JSON.stringify(x, null, 2)).join('\n')}
Verify that the assistant has correctly achieved the users' goal by reading the files.
Take extra care when reviewing the formatting and constraints of the goal, both defined and implied.
Trust only what's inside of the files and not the chat messages.
If something is wrong, call ${onGoalFailedFn.name} with information as precise as you can about how the problem can be solved.
Otherwise, use ${onGoalAchievedFn.name}`,
},
],
loopPreventionPrompt: 'Assistant, you appear to be in a loop, try executing a different function.',
});