Liking cljdoc? Tell your friends :D

bosquet.llm.generator


all-keysclj

(all-keys prompts data)

Produce a list of all the data keys that will come out of the Pathom processing. Whatever is refered in prompts and comes in via input data

Produce a list of all the data keys that will come out of the Pathom processing.
Whatever is refered in `prompts` and comes in via input `data`
raw docstring

chatclj

(chat messages)
(chat messages inputs)
(chat messages inputs opts)

completecljdeprecated

(complete prompt-palette data)
(complete prompt-palette data entry-prompt-keys)
(complete prompt-palette data entry-prompt-keys opts)

Given a prompt-palette and a map of data to fill in template slots, generate text as a combination of template slot filling and AI generation.

entry-prompts are the keys to the prompt-palette indicating where to start the generation process.

When not provided, all keys in prompt-palette are used. With big prompt palettes, this can be a problem, because multiple unrelated prompts can be invoked

Given a `prompt-palette` and a map of `data` to fill in template slots,
generate text as a combination of template slot filling and AI generation.

`entry-prompts` are the keys to the `prompt-palette` indicating where to start
the generation process.

When not provided, all keys in `prompt-palette` are used.
With big prompt palettes, this can be a problem, because multiple unrelated
prompts can be invoked
raw docstring

complete-templateclj

(complete-template template)
(complete-template template slots)
(complete-template template slots config)

Fill in template slots with Selmer and call generation function (if present) to complete the text.

This is a sole template based generation bypasing Pathom resolver figuring out the sequence of multiple template gen calls. Hence the parameter is not a map with multiple templates but a single template string.

If template has no gen tag, then it will be added to the end of the template.

Likely to be refactored away in the future versions in favour of a single complete entry point.

Note that template can have only one gen call.

OK : 'Generate a joke about {{topic}}. {% gen var-name=joke %}' BAD: 'Generate a joke about {{topic}}. {% gen var-name=joke %} and {% gen var-name=another-joke %'

Fill in `template` `slots` with Selmer and call generation function
(if present) to complete the text.

This is a sole template based generation bypasing Pathom resolver figuring out
the sequence of multiple template gen calls. Hence the parameter is not
a map with multiple templates but a single template string.

If `template` has no `gen` tag, then it will be added to the end of the template.

Likely to be refactored away in the future versions in favour of a single
`complete` entry point.

Note that `template` can have only one `gen` call.

OK : 'Generate a joke about {{topic}}. {% gen var-name=joke %}'
BAD: 'Generate a joke about {{topic}}. {% gen var-name=joke %} and {% gen var-name=another-joke %'
raw docstring

generateclj

(generate prompts)
(generate prompts inputs)
(generate prompts inputs config)

output-keysclj

(output-keys k template)

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close