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

Add prompt templates for formats so users don't have to constrain the output #42

Closed
JasonWeill opened this issue Apr 7, 2023 · 1 comment · Fixed by #53
Closed

Add prompt templates for formats so users don't have to constrain the output #42

JasonWeill opened this issue Apr 7, 2023 · 1 comment · Fixed by #53
Labels
enhancement New feature or request @jupyter-ai/magics
Milestone

Comments

@JasonWeill
Copy link
Collaborator

Problem

When users customize the output format using the -f/--format option to the magic command, the prompt may still cause the AI to output in a format that the magic command can't display. For example, if the user asks for HTML markup, the AI model may generate explanatory text that is not in HTML format.

Proposed Solution

For each supported output format, write a prompt template. Apply the prompt template to the specified prompt before sending it to the AI model.

In the examples below, the prompt template is indicated in bold.

%%ai anthropic:claude-v1.2 -f html
Create a square using SVG with a black border and white fill.

… would send:

Create a square using SVG with a black border and white fill. The output should be in HTML format only, with no text before or after.

%%ai chatgpt -f math
Generate the 2D heat equation

… would send:

Generate the 2D heat equation

The output should be in LaTeX surrounded by $$. Do not include an explanation.

@JasonWeill
Copy link
Collaborator Author

Fixed by #53.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request @jupyter-ai/magics
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant