buszk / obsidian-ai-editor

MIT License
22 stars 6 forks source link

Add `{{input}}`/`{{prompt}}` tokens for output format? #3

Open treyharris opened 10 months ago

treyharris commented 10 months ago

Could there be a couple tokens added to include the input in the formatted output? I was thinking of two:

  1. {{input}} — The unmodified input text directly as in the document/selection, but not including anything in the action configuration.
  2. {{prompt}} — The entire API input including action prompts.

I think {{prompt}} is less important than {{input}}, but I can imagine situations where it might be helpful. Whether it would be better to have a separate token for the configured text versus the variable input text, one like my description of {{prompt}} that includes both, or all three is a design decision I’ll leave to you.

Usage would be like setting Output Format to:

> [!question] Question:
> {{input}}

> [!bot] GPT:
> {{result}}

(In this case, only the first line sent back would be included in the block, and I can imagine where one might want to integrate with Templater or something to put quote escapes before each line. But I use the Callout Integrator plugin for this, so I don’t mind.)