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() -> Self

An empty builder with the conservative configuration.

Source

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

The workflows this runtime hosts.

Source

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

The configured providers.

Source

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

The persistence layer.

Source

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

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

Source

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

The directory of addressable cases.

Source

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

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

Source

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

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

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

Source

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

Where metrics go (spec §26.2).

Source

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

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

Source

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

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

Source

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

Replaces the runtime clock.

Source

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

Replaces the factory that mints identifiers for new cases.

Source

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

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

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

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

Replaces the composition stage.

Source

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

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

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

Source

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

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

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

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

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

impl Default for OrchestratorBuilder

Source§

fn default() -> Self

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> 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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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