Skip to main content

Module prompt_assembler

Module prompt_assembler 

Source
Expand description

PromptAssembler — the algorithm that turns every contribution into the blocks one request carries.

Contributing a block and rewriting one are already open: a registration adds, an AssemblyHook gets a last pass over the result. What was not open is the assembly itself — the order stages are placed in, how a contribution’s order merges with the kernel’s, where the cache boundaries fall, whether two blocks stay two blocks. Those are decisions assemble_prompt_with makes, and a deployment that wants different ones had to make them by bolting a hook on the end and undoing the arrangement it had just been handed.

§The inputs are a value

Assembly reads ten things. Passing them as a struct is not a style preference: an implementation that wants only two should not have to restate the other eight, and a new input should not break every implementation that never asked for one.

Structs§

AssemblyRequest
Everything one assembly reads.

Traits§

PromptAssembler
How a request’s system prompt gets built.