Skip to main content

ContextComponent

Trait ContextComponent 

Source
pub trait ContextComponent: Send + Sync {
    // Required methods
    fn id(&self) -> ContextComponentId;
    fn build_context_section<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Option<String>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

A composable unit that contributes to the context message. Implementations provide specific sections of context content. Components should be self-contained - owning any state they need.

Required Methods§

Source

fn id(&self) -> ContextComponentId

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

Source

fn build_context_section<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Option<String>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

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

Implementors§