Module prompt_template

Module prompt_template 

Source
Expand description

Prompt Template — type-safe system prompt construction.

PromptTemplate replaces System(String) in MessageContent to prevent user data from being smuggled through the system prompt escape hatch.

A PromptTemplate can only be built from:

  • &'static str literals (known at compile time)
  • ScrubbedText (already through PII redaction)

There is no path from an arbitrary String into a PromptTemplate.

Structs§

PromptTemplate
A system prompt built from static templates + pre-scrubbed inserts.
PromptTemplateBuilder
Builder for PromptTemplate.

Enums§

PromptSegment
A single segment of a prompt template.