Generative AI Scripting
Prompting is Coding
Programmatically assemble prompts for LLMs using JavaScript.
$`Analyze ${env.files} and report errors. Use gitmojis.`
Of course, things can get more complex…
// define the contextdef("FILE", env.files, { endsWith: ".pdf" })// structure the dataconst schema = defSchema("DATA", { type: "array", items: { type: "string" } })// assign the task$`Analyze FILE and extract data to JSON.`// save results to filedefFileOutput("*.pdf.txt", "Extracted data", { schema })// toolsdefTool("wea...
Read more at microsoft.github.io