Skip to content

Commit

Permalink
Add more examples to agents (#234)
Browse files Browse the repository at this point in the history
  • Loading branch information
nsarrazin authored Jul 26, 2023
1 parent ec2bd26 commit 7eceeaa
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
24 changes: 24 additions & 0 deletions packages/agents/src/lib/examples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
4 changes: 2 additions & 2 deletions packages/agents/src/lib/promptGeneration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 7eceeaa

Please sign in to comment.