lmql
lmql copied to clipboard
Query Request Builder
Hi, this looks like a great utility for creating structured responses from LLMs! I do have one suggestion however in terms of using the builder pattern for constructing queries programmatically instead of via free-text style docstrings. This would help improve the overall API of the interface and user experience.
Thanks for suggesting this, it it is definitely a good idea. I will keep this issue to track progress/work on this.
Marking this as a good first issue.
A query request builder would just construct an LMQL string, that is then passed to the LMQL compiler to produce a callable LMQL query function (the compiler lives here https://github.com/eth-sri/lmql/blob/main/src/lmql/language/compiler.py#L428).
As an implementation exercise, this requires some understanding of the full LMQL syntax (see https://lmql.ai/docs/language/reference.html).