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

Template support for schemas #778

Closed
simonw opened this issue Feb 27, 2025 · 1 comment · Fixed by #787
Closed

Template support for schemas #778

simonw opened this issue Feb 27, 2025 · 1 comment · Fixed by #787
Labels
enhancement New feature or request schemas

Comments

@simonw
Copy link
Owner

simonw commented Feb 27, 2025

Things like llm --schema '{...}' --save dogs should work - then you can do llm -t dogs 'describe 2 dogs'.

@simonw
Copy link
Owner Author

simonw commented Feb 27, 2025

Original idea:

I should make it so templates can have schemas saved to them, which get persisted in the YAML.

That way you could do this:

curl $URL | llm -t extract-headlines

Combined with without logging idea, it might be worth having a --silent option for llm prompt which causes the response to be logged but not output.

@simonw simonw linked a pull request Feb 27, 2025 that will close this issue
3 tasks
simonw added a commit that referenced this issue Feb 27, 2025
simonw added a commit that referenced this issue Feb 27, 2025
* Don't hang on stdin if llm -t template-with-schema
* Docs on using schemas with templates
* Schema in template YAML file example
* Test for --save with --schema

Refs #778
simonw added a commit that referenced this issue Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request schemas
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant