Skip to main content

FanOutConfig

Struct FanOutConfig 

Source
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: usize

Most 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: WorkerFailurePolicy

How to handle worker failures.

§split_prompt: String

Prompt 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

Source

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

Source§

fn clone(&self) -> FanOutConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FanOutConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for FanOutConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for FanOutConfig

Source§

impl PartialEq for FanOutConfig

Source§

fn eq(&self, other: &FanOutConfig) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for FanOutConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for FanOutConfig

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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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<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