Skip to main content

OrchestratorBuilder

Struct OrchestratorBuilder 

Source
pub struct OrchestratorBuilder { /* private fields */ }
Expand description

Collects everything one Orchestrator needs.

Implementations§

Source§

impl OrchestratorBuilder

Source

pub fn new() -> OrchestratorBuilder

An empty builder with the conservative configuration.

Source

pub fn workflows(self, workflows: Arc<WorkflowRegistry>) -> OrchestratorBuilder

The workflows this runtime hosts.

Source

pub fn providers(self, providers: Arc<ProviderPool>) -> OrchestratorBuilder

The configured providers.

Source

pub fn stores(self, stores: Stores) -> OrchestratorBuilder

The persistence layer.

Source

pub fn consequences( self, consequences: Arc<dyn TurnConsequences>, ) -> OrchestratorBuilder

Declares what a turn’s writes imply on other cases. See TurnConsequences.

Source

pub fn case_directory( self, directory: Arc<dyn CaseDirectory>, ) -> OrchestratorBuilder

The directory of addressable cases.

Source

pub fn knowledge( self, knowledge: Arc<dyn KnowledgeProvider>, ) -> OrchestratorBuilder

The knowledge provider answers may rest on (spec §19.2).

Source

pub fn attachments( self, source: Arc<dyn AttachmentSource>, ) -> OrchestratorBuilder

Where the bytes of the turn’s files come from. Without one, no model is shown a file.

Source

pub fn policy(self, policy: PolicySnapshot) -> OrchestratorBuilder

The policy snapshot commands are judged against (spec §14.3).

Source

pub fn observer(self, observer: Arc<dyn Observer>) -> OrchestratorBuilder

Where metrics go (spec §26.2).

Source

pub fn mode(self, mode: OrchestrationMode) -> OrchestratorBuilder

How much autonomy the model gets (spec §11.1). Refused beside Self::config; see BuildError::ConflictingMode.

Source

pub fn config(self, config: OrchestratorConfig) -> OrchestratorBuilder

The whole configuration, mode included. Refused beside Self::mode.

Source

pub fn clock(self, clock: Arc<dyn TurnClock>) -> OrchestratorBuilder

Replaces the runtime clock.

Source

pub fn case_id_factory( self, factory: Arc<dyn CaseIdFactory>, ) -> OrchestratorBuilder

Replaces the factory that mints identifiers for new cases.

Source

pub fn understander( self, understander: Arc<dyn TurnUnderstander>, ) -> OrchestratorBuilder

Replaces what understands each turn. The default is an Understander over the configured providers, with the profiles and settings of UnderstandingConfig.

Source

pub fn prompt_source(self, source: Arc<dyn PromptSource>) -> OrchestratorBuilder

Lets a prompt source supply the instructions of every model task.

Without one the runtime uses the text compiled into the library. Each task asks for its own name, understand.<task> or narrate.<task>, and its record cites the prompt it ran under. It applies to the stages this builder creates.

Source

pub fn prompt_selector(self, selector: PromptSelector) -> OrchestratorBuilder

Which version of each prompt the source is asked for. Pin one, so an edit in a registry cannot change a running system.

Source

pub fn composer(self, composer: Composer) -> OrchestratorBuilder

Replaces the composition stage.

Source

pub fn notice_copy(self, copy: NoticeCopy) -> OrchestratorBuilder

Replaces the notices the reducer writes itself. English by default; a deployment in another language wants this, the composer’s copy and Self::confirmation_copy.

Source

pub fn attachment_copy(self, copy: AttachmentCopy) -> OrchestratorBuilder

Replaces what a user is told about a file the model was not shown.

Source

pub fn locales<L>( self, locales: impl IntoIterator<Item = L>, ) -> OrchestratorBuilder
where L: Into<Locale>,

The languages this deployment serves: building fails while any of the server’s own sentences has no text in one of them. The built-in copy speaks English and Italian.

Source

pub fn confirmation_copy(self, copy: ConfirmationCopy) -> OrchestratorBuilder

Replaces the copy on the cards the policy engine raises, the two buttons of every confirmation card included.

Source

pub fn trace(self, trace: Arc<dyn TurnTrace>) -> OrchestratorBuilder

Reports every turn’s events to trace: for local debugging, since a trace holds the users’ words. Wrap the providers in TracedProvider to add the model calls. See crate::trace.

Source

pub fn build(self) -> Result<Orchestrator, BuildError>

Builds the orchestrator.

§Errors

BuildError::Missing for the first mandatory part not supplied, BuildError::Config for a configuration the library refuses, and BuildError::ConflictingMode.

Trait Implementations§

Source§

impl Debug for OrchestratorBuilder

Source§

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

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

impl Default for OrchestratorBuilder

Source§

fn default() -> OrchestratorBuilder

Returns the “default value” for a type. Read more

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

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

Source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
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 = !

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