pub struct FanOutConfig {
pub worker_agent: Option<String>,
pub worker_stage: Option<String>,
pub worker_query: Option<String>,
pub merge_stage: Option<String>,
pub max_workers: usize,
pub on_worker_failure: WorkerFailurePolicy,
pub split_prompt: String,
pub results_region: Option<String>,
pub max_items: Option<usize>,
pub max_attempts: Option<usize>,
}Expand description
Configuration for a StageMode::FanOut stage.
Exactly one of worker_agent / worker_stage / worker_query selects the
worker’s agent type (validated when the blueprint’s graph is checked).
Fields§
§worker_agent: Option<String>A separate registered/installed blueprint run as the worker agent type.
worker_stage: Option<String>A stage in this blueprint (self-as-agent-type); must be marked
allow_as_worker = true.
worker_query: Option<String>Discovery hint matched against installed agent types.
merge_stage: Option<String>Optional stage that reconciles worker results before transitioning.
max_workers: usizeMost workers running at once. Defaults to DEFAULT_MAX_WORKERS.
0 means unlimited: every work item starts as soon as the split has
produced it, and the daemon’s inference pool ([limits] max_concurrent_inferences) is what paces the requests. Read it through
Self::worker_cap rather than comparing against zero by hand.
on_worker_failure: WorkerFailurePolicyHow to handle worker failures.
split_prompt: StringPrompt that produces the JSON array of work items (one per worker).
results_region: Option<String>Context region the consolidated worker report is written to. None
means conversation.
Worth naming when the results are bulky. conversation is a sliding
window carrying the message history, so a large report competes with the
turns around it and can be evicted by them. A region of its own gets a
budget of its own, and that budget is what each worker’s share is
divided from.
max_items: Option<usize>Most work items the split may produce. None means however many it
produces (a manifest spells that max_items = 0, or leaves the key
out).
Distinct from max_workers, which caps how many run at once. This
caps how many there are at all, which is what bounds both the run’s cost
and each worker’s share of the results region: split a hundred ways and
every worker’s contribution is a hundredth of the space.
max_attempts: Option<usize>How many times this stage is asked again when it ends without having
called the fan-out tool, before it is let through without workers.
None means DEFAULT_FAN_OUT_ATTEMPTS.
Starting the workers is the whole job of a fan-out stage, so a model
that answers in prose instead is asked again. The budget is bounded
because a run must never be stranded over a thing the model will not do,
and it is separate from max_revisits because those are different
questions: “how many times may the graph re-enter this stage” and “how
many times do we ask a model that has not done what the stage is for”.
Borrowing the first for the second is how a routing setting silently
multiplies an inference bill.
Raise it for a small or local model that needs more than a nudge; 0
lets the stage through on its first refusal, which is the right setting
when an empty fan-out is an acceptable outcome and the retries are not
worth their prompts.
Implementations§
Source§impl FanOutConfig
impl FanOutConfig
Sourcepub fn worker_cap(&self) -> Option<usize>
pub fn worker_cap(&self) -> Option<usize>
The concurrency cap as an option: Some(n) for max_workers = n,
None when the stage is unlimited (max_workers = 0).
The runtime and the API both want the question answered this way, and answering it in one place keeps “zero is unlimited” from being restated wherever the number is read.
Trait Implementations§
Source§impl Clone for FanOutConfig
impl Clone for FanOutConfig
Source§fn clone(&self) -> FanOutConfig
fn clone(&self) -> FanOutConfig
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 FanOutConfig
impl Debug for FanOutConfig
Source§impl<'de> Deserialize<'de> for FanOutConfig
impl<'de> Deserialize<'de> for FanOutConfig
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>,
impl Eq for FanOutConfig
Source§impl PartialEq for FanOutConfig
impl PartialEq for FanOutConfig
Source§impl Serialize for FanOutConfig
impl Serialize for FanOutConfig
impl StructuralPartialEq for FanOutConfig
Auto Trait Implementations§
impl Freeze for FanOutConfig
impl RefUnwindSafe for FanOutConfig
impl Send for FanOutConfig
impl Sync for FanOutConfig
impl Unpin for FanOutConfig
impl UnsafeUnpin for FanOutConfig
impl UnwindSafe for FanOutConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.