pub struct FollowUpLink {
pub tool: String,
pub probability: f32,
pub projection: Option<String>,
pub projection_arg: Option<String>,
}Expand description
Edge in the empirically observed follow-up graph. After tool A
fires, the planner consults A’s follow_up list to decide which
tools to speculatively prefetch.
Default returns an empty link (tool = "",
probability = default_followup_probability). The implementation
is mostly there so call sites can use struct-update syntax
(FollowUpLink { tool: …, probability: …, ..Default::default() })
— the empty tool would never resolve in enumerate_candidates.
Fields§
§tool: StringName of the tool that typically fires next.
probability: f32Probability of this follow-up firing, mined from corpus. Range 0.0–1.0; 0.5+ is a reasonable prefetch threshold.
projection: Option<String>Optional argument projection — name of the field from the
previous response to read. For example,
Glob.follow_up = [{tool: "Read", projection: "match_path", projection_arg: "file_path"}] tells the planner to take each
glob result’s match_path and feed it as the file_path
argument to Read.
projection_arg: Option<String>Optional argument name on the follow-up tool that the
extracted projection value should populate. When None, the
provider’s ToolEnricher::project_args is asked to build the
arguments instead — that’s the right path for built-in tools
where mapping is hard-coded. Custom MCP tools that the user
annotates by hand in pipeline_config.toml should set both
projection and projection_arg so the planner can build the
follow-up args without provider code.
Trait Implementations§
Source§impl Clone for FollowUpLink
impl Clone for FollowUpLink
Source§fn clone(&self) -> FollowUpLink
fn clone(&self) -> FollowUpLink
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FollowUpLink
impl Debug for FollowUpLink
Source§impl Default for FollowUpLink
impl Default for FollowUpLink
Source§fn default() -> Self
fn default() -> Self
Empty link with the default probability — wouldn’t resolve in
the planner. Provided so callers can use struct-update syntax:
FollowUpLink { tool: …, probability: …, ..Default::default() }
without spelling every optional field. f32 has no useful
Default::default() here (would be 0.0), so we hand-write
the impl rather than derive.
Source§impl<'de> Deserialize<'de> for FollowUpLink
impl<'de> Deserialize<'de> for FollowUpLink
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for FollowUpLink
impl PartialEq for FollowUpLink
Source§fn eq(&self, other: &FollowUpLink) -> bool
fn eq(&self, other: &FollowUpLink) -> bool
self and other values to be equal, and is used by ==.