Skip to main content

Crate entelix_prompt

Crate entelix_prompt 

Source
Expand description

§entelix-prompt

Prompt primitives — PromptTemplate, ChatPromptTemplate, MessagesPlaceholder, FewShotPromptTemplate, ChatFewShotPromptTemplate, ExampleSelector. All implement Runnable so they compose with codecs, parsers, tools and graphs through .pipe().

Surface: PromptTemplate, ChatPromptTemplate, ChatPromptPart, MessagesPlaceholder, PromptValue, PromptVars, FewShotPromptTemplate, ChatFewShotPromptTemplate, ExampleSelector + FixedExampleSelector + LengthBasedExampleSelector.

Structs§

ChatFewShotPromptTemplate
Chat-shape few-shot prompt.
ChatPromptTemplate
Heterogeneous list of templated messages and placeholders. Renders to Vec<Message> — the input type expected by entelix_core::ChatModel.
FewShotPromptTemplate
String-shape few-shot prompt.
FixedExampleSelector
Returns the configured examples verbatim, regardless of input.
LengthBasedExampleSelector
Selector that caps the rendered example total at a character budget.
MessagesPlaceholder
Placeholder whose value at render time is a Vec<Message> (typically chat history).
PromptTemplate
A Jinja2-syntax template that renders to String from a variables map.

Enums§

ChatPromptPart
One slot in a ChatPromptTemplate: either a templated message (role + text template) or a placeholder for a Vec<Message> variable.
PromptValue
A variable’s value: either text (for templated parts) or a list of messages (for placeholders).

Traits§

ExampleSelector
Strategy that picks which examples to inject into a few-shot prompt.

Type Aliases§

Example
One few-shot example: a map of example-prompt variable name → value.
PromptVars
Map of variable name → value, accepted by ChatPromptTemplate::render and the Runnable impl.
SharedExampleSelector
Convenience type-alias for selectors handed around as trait objects.