AI Prompts in Templates
With version 3.15.1 you can add AI prompts to your templates.
Example 1 (inside a template):
**Random Annual Goal:** <%- await NotePlan.ai("Return a bullet. Not just the first one, make it random", ["this year"]) %>
**Think:** <%- await NotePlan.ai("Return 3 stoic inspirational quotes") %>
Here's how the function works:
/* * @param { String } * @param { String[] } * @param { Boolean } * @return { Promise<String> } */ NotePlan.ai(prompt, filenames, useStrictFilenames)
It's async function, use it with "await". It sends a prompt to OpenAI and returns the result as text. Optionally send the content of some notes by specifying them in the second argument 'filenames', as a list. For example ["note1.md", "folder/note2.md"]. This needs to be the exact path to the note. Your note extension might differ, the default is .txt, if you haven't changed it.
For calendar notes, you can use YYYYMMDD.md, like 20241101.md, or 2024-W10.md for weeks, etc. Natural language input is also supported like "this week", "today", "tomorrow", "this month", "next year", etc.
Use the third argument (adding 'true') if you don't want to use natural language processing like "this week" (in case you have a note that's called this).