Skip to main content

CollectedCapabilities

Struct CollectedCapabilities 

Source
pub struct CollectedCapabilities {
    pub system_prompt_parts: Vec<String>,
    pub system_prompt_attributions: Vec<SystemPromptAttribution>,
    pub tools: Vec<Box<dyn Tool>>,
    pub tool_definitions: Vec<ToolDefinition>,
    pub mounts: Vec<MountPoint>,
    pub message_filter_providers: Vec<(Arc<dyn MessageFilterProvider>, Value)>,
    pub applied_ids: Vec<String>,
    pub tool_search: Option<ToolSearchConfig>,
    pub prompt_cache: Option<PromptCacheConfig>,
    pub tool_definition_hooks: Vec<Arc<dyn ToolDefinitionHook>>,
    pub tool_call_hooks: Vec<Arc<dyn ToolCallHook>>,
    pub mcp_servers: ScopedMcpServers,
}
Expand description

Collected data from capabilities before applying to config.

This intermediate struct allows sharing the capability collection logic between apply_capabilities and apply_capabilities_to_builder.

Fields§

§system_prompt_parts: Vec<String>

System prompt additions (in order)

§system_prompt_attributions: Vec<SystemPromptAttribution>

Source attribution for each system prompt addition.

§tools: Vec<Box<dyn Tool>>

Tool implementations for the registry

§tool_definitions: Vec<ToolDefinition>

Tool definitions for config

§mounts: Vec<MountPoint>

Mount points from capabilities

§message_filter_providers: Vec<(Arc<dyn MessageFilterProvider>, Value)>

Message filter providers with their configs (in priority order)

§applied_ids: Vec<String>

IDs of capabilities that were collected

§tool_search: Option<ToolSearchConfig>

Tool search configuration (set when openai_tool_search capability is present)

§prompt_cache: Option<PromptCacheConfig>

Prompt caching configuration (set when prompt_caching capability is present)

§tool_definition_hooks: Vec<Arc<dyn ToolDefinitionHook>>

Hooks that transform the final runtime tool definition list.

§tool_call_hooks: Vec<Arc<dyn ToolCallHook>>

Hooks that inspect or transform model-produced tool calls.

§mcp_servers: ScopedMcpServers

Scoped remote MCP servers contributed by capabilities.

Implementations§

Source§

impl CollectedCapabilities

Source

pub fn system_prompt_prefix(&self) -> Option<String>

Returns the combined system prompt prefix from all capabilities. Returns None if no capabilities contributed system prompt additions.

Source

pub fn apply_message_filters(&self, query: &mut MessageQuery)

Apply all collected message filter providers to a query.

Providers are applied in priority order (lower priority first).

Source

pub fn apply_post_load_filters(&self, messages: &mut Vec<Message>)

Apply post-load transforms from all message filter providers. Called after messages are loaded, filtered, and injected.

Source

pub fn has_message_filters(&self) -> bool

Check if any capabilities contribute message filters.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more