Examplary (a example-oriented programming language)
Install with Pen | |
---|---|
Pen.el on GitHub | https://github.com/semiosis/pen.el/ |
Tutorial | https://mullikine.github.io/posts/pen-el-tutorial/ |
Examplary
is an example-oriented DSL that can be used to construct and
compose functions based on prompts and external String->String
commands.
- Emacs Lisp: http://github.com/semiosis/pen.el/blob/master/src/pen-examplary.el
- Clojure: http://github.com/semiosis/examplary
Using examplary, one can keep track of their various String->String
functions
but also:
- generate prompts from an example generator
- design prompts using design patterns
|
|
Emacs-lisp implementation
Generate input with :gen
when example input is not present.
Use shell or emacs lisp for generators and filters.
|
|
With regards to the list of examples, the third argument (if supplied) should be incorrect output (a counterexample).
If the 2nd argument is left out, it will be
generated by the command specified by
:external
.
Leave out :task
to have it inferred.
|
|
Even leave out :gen
to have it inferred from
tthe variable name.
|
|
Clojure implementation
Here are some examples:
|
|
syntax | description |
---|---|
:g |
external generator command |
:i |
specifies a source of input (training) strings from a jsonl file |
:o |
specifies an output file for outputting jsonl |
- external generator command
- specifies an external [pipable] command which can generate examples or as a source of truth for query reformulation (when generating prompts)
Related links
- Code: http://github.com/semiosis/examplary
- Design patterns: http://github.com/semiosis/prompt-engineering-patterns