gptel
gptel copied to clipboard
Evaluate elisp/shell in prompts
Currently prompts can only be static. Adding syntax that would evaluate an elisp statement / shell commands would allow dynamic prompting.
Potential Use Cases
Data extraction from local machine
Gives the ability to load data from a shell command, local file, ect, into the prompt without copy paste.
# prompt
Format the contents of a directory as a table of contents in markdown: (shell-command-to-string "ls")
or
# prompt
Format the contents of a directory as a table of contents in markdown: $(ls)
Prompt organization
(technically the same thing as the previous) Would allow organization of long complex prompts
# Directory structure
# TODO-1.org
# TODO-2.org
# TODO-3.org
# Prompt
You are a careful programmer. Complete all TODO instructions. First $(cat TODO-1.org), then $(cat TODO-2.org), then $(cat TODO-3.org)
Example from Alternative
>>> sgpt "format the contents of a directory as a markdown table of contents: $(ls)"
- [README.md](README.md)
- [some-file.md](some-file.md)
- [documents](documents)