pub trait ContextContributor: Send + Sync {
// Provided methods
fn contribute_thread_context<'a>(
&'a self,
session_store: &'a ExtensionData,
thread_store: &'a ExtensionData,
step_store: &'a ExtensionData,
) -> ExtensionFuture<'a, Vec<PromptFragment>> { ... }
fn contribute_turn_context<'a>(
&'a self,
input: TurnContextContributionInput<'a>,
) -> ExtensionFuture<'a, Vec<PromptFragment>> { ... }
fn contribute_world_state<'a>(
&'a self,
input: WorldStateContributionInput<'a>,
) -> ExtensionFuture<'a, Vec<WorldStateSectionContribution>> { ... }
}Expand description
Extension contribution that adds prompt fragments during prompt assembly.
Implementations should use the method matching the scope needed by the fragment: thread/session context for stable inputs, and turn context for fragments that depend on turn-local host state.
Provided Methods§
Sourcefn contribute_thread_context<'a>(
&'a self,
session_store: &'a ExtensionData,
thread_store: &'a ExtensionData,
step_store: &'a ExtensionData,
) -> ExtensionFuture<'a, Vec<PromptFragment>>
fn contribute_thread_context<'a>( &'a self, session_store: &'a ExtensionData, thread_store: &'a ExtensionData, step_store: &'a ExtensionData, ) -> ExtensionFuture<'a, Vec<PromptFragment>>
Returns thread-scoped context using capabilities from the current sampling step.
fn contribute_turn_context<'a>( &'a self, input: TurnContextContributionInput<'a>, ) -> ExtensionFuture<'a, Vec<PromptFragment>>
fn contribute_world_state<'a>( &'a self, input: WorldStateContributionInput<'a>, ) -> ExtensionFuture<'a, Vec<WorldStateSectionContribution>>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".