You can read about what I mean in the page about CedarTL.
In the example on that page, the user typed what does this file do? \l0
and the templating engine turned that into:
\l0: \rar\sbs
\rar: Rephrase my request, then respond.
\sbs: Do so by thinking step by step.
what does this file do? Rephrase my request, then respond.
Do so by thinking step by step.
Here's an actual session screenshot:
Frequently-used pieces of text can be stored in named templates. Then, instead of typing the same text over and over, you just put a reference to the named template.
Implementing this could be simple for an IDE or editor. For Kagi, it would entail other details as well, but the idea is something like this:
from cedartl import CedarTLProcessor
from importlib.resources import files
# [...]
class ExistingClass:
def __init__(self):
self.template_processor = CedarTLProcessor(files('resources.templates.main'))
def process_user_input(self, input: str):
# ...
processed_input: str = self.template_processor.process(input)
# ...
It could be implemented either at the server side, or as a browser plugin using local storage for the templates.