Skip to main content

PromptComponent

Trait PromptComponent 

Source
pub trait PromptComponent: Send + Sync {
    // Required methods
    fn id(&self) -> PromptComponentId;
    fn build_prompt_section(&self, settings: &Settings) -> Option<String>;
}
Expand description

A composable unit that contributes to the system prompt. Implementations provide specific sections of prompt content.

Required Methods§

Source

fn id(&self) -> PromptComponentId

Returns the unique identifier for this component. This ID is used for filtering via PromptComponentSelection.

Source

fn build_prompt_section(&self, settings: &Settings) -> Option<String>

Returns the prompt section content, or None if this component should not contribute to the current prompt.

Implementors§