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

Prompt Templates #14

Closed
DavidSouther opened this issue Mar 16, 2024 · 0 comments · Fixed by #22
Closed

Prompt Templates #14

DavidSouther opened this issue Mar 16, 2024 · 0 comments · Fixed by #22

Comments

@DavidSouther
Copy link
Owner

DavidSouther commented Mar 16, 2024

Pass prompts through templates. Provide a library of common snippets (eg: common instructions for telling models to user certain output formats, prefer certain thinking styles, or ignore types of information). Allow plugin and user defined additional parameters, for instance, project "You are a..." prompts.

  1. Include ESM mustache
  2. Pass content through mustache on load.
  3. Load template view object by shallow merging, in order (later overrides earlier):
    a. Default global view with documented formatting control snippets
    b. Additional Engine view with documented model-specific snippets
    c. Additional Plugin view for project plugins to provide snippets
    d. --template repeated command line flag to provide additional snippets in JSON (YAML?) format
    e. template: key in .aillyrc grey matter
  4. Suppress template expansion with template: false in greymatter (inherited through .aillyrc) or --no-template command line flag

Example:

.aillyrc

{{project.user}}
{{project.overview}}
In this task, we are brainstorming for a corporate branding.
The brand is a new line of seltzer.

10_overview.md

{{output.format.ad_json}}

Create an an ad spot for this product.

with the view:

{
  project: {
    user: "You are a corporate marketing consultant.",
    project: "The group works as an embedded team and views the clients' success as their own."
  },
  output: {
    prose: "Your output should be prose, with no additional formatting.",
    markdown: "Your output should use full markdown syntax.",
    python: "Your output should only contain Python code, within a markdown code fence:\n\n```py\n#<your code>\n```"
    ad_json: "Your output will be a JSON document with fields 'campaign_id' and 'ad_copy'."
  }
}

Would fill out:

System:
You are a...
The group works as…
In this task…
The brand...

Human:
Your output will be...
Create an an ad spot for this product.
DavidSouther added a commit that referenced this issue Apr 3, 2024
DavidSouther added a commit that referenced this issue Apr 3, 2024
* Rename `rag` to `plugin` in PromptThread
* Add mustache processing to prompt.
* Add prompt templating and view coalescing.

Closes #14.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant