Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evaluate elisp/shell in prompts #328

Open
osheari1 opened this issue Jun 18, 2024 · 3 comments
Open

Evaluate elisp/shell in prompts #328

osheari1 opened this issue Jun 18, 2024 · 3 comments
Labels
feature request Request for a new feature

Comments

@osheari1
Copy link

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

shell_gpt

>>> 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)
@osheari1 osheari1 changed the title Evaluate elisp in prompts Evaluate elisp/shell in prompts Jun 18, 2024
@karthink
Copy link
Owner

Thanks, this is a neat idea. I'll look into adding something like this.

@karthink karthink added the feature request Request for a new feature label Jun 27, 2024
@nfedyashev
Copy link
Contributor

Super excited about this
Another probable use case:
elisp function that reads database schema and the injects it into the prompt, "given the following DB schema \n... write SQL migration that does X"

@karthink
Copy link
Owner

karthink commented Sep 2, 2024

This is still on the docket -- I just need to fix a few other things in gptel before I can get to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Request for a new feature
Projects
None yet
Development

No branches or pull requests

3 participants