diff --git a/packages/agents/src/lib/examples.ts b/packages/agents/src/lib/examples.ts index 867ce383a..993da22b8 100644 --- a/packages/agents/src/lib/examples.ts +++ b/packages/agents/src/lib/examples.ts @@ -51,6 +51,30 @@ if (output.includes("dog")) { tools: ["imageToText", "textToImage"], inputs: { image: true }, }, + { + prompt: "Who Was Napoléon Bonaparte?", + code: `async function generate() { + message("Napoléon Bonaparte was a French military and political leader."); +}`, + tools: ["message"], + }, + { + prompt: "What is 5+5?", + code: `async function generate() { + message(\`5+5 is equal to ${5 + 5}\`); +}`, + tools: ["message"], + }, + + { + prompt: "Can you draw the current president of France?", + code: `async function generate() { + const output = await textToImage("Emmanuel Macron"); + message("The current president of France", output); + return output +}`, + tools: ["textToImage", "message"], + }, ]; export default examples; diff --git a/packages/agents/src/lib/promptGeneration.ts b/packages/agents/src/lib/promptGeneration.ts index 6900d97de..0310d5a0e 100644 --- a/packages/agents/src/lib/promptGeneration.ts +++ b/packages/agents/src/lib/promptGeneration.ts @@ -62,9 +62,9 @@ async function generate(${params}) { // your code here return output; }; +\`\`\` -If you are not sure how to do it, try anyway and give it your best shot, as the user can always correct you later. Wrap your code answer in triple backticks (\`\`\`). -\`\`\``; +If you are not sure how to do it, try anyway and give it your best shot, as the user can always correct you later.`; return fullPrompt; }