TfTHacker / obsidian-ai-templater

Extends Templater with AI Chat commands using the OpenAI Client Library
https://tfthacker.com/AIT
MIT License
33 stars 2 forks source link

Using inside a templater template #1

Closed Cossackx closed 7 months ago

Cossackx commented 7 months ago

figured it out (with chatgpt)... Key Adjustments Made Function Return Changed to tR Addition: Changed return to tR +=. Using return in Templater scripts might prematurely terminate the template processing, especially when you intend to add more content to your journal entry. By using tR +=, you ensure that the generated content is added to the ongoing template text without disrupting the continuation of the template. Regular Expression Adjustments: Updated to remove any blockquote markers (>) that might be added by the AI. Ensured that Markdown headers and quotes are effectively stripped from the response. Use of tR: This variable is used to accumulate text within Templater scripts. It’s important to use this to append content rather than just return a single value, which helps when you have multiple Templater blocks or static content following the script.