pub struct OrchestratorBuilder { /* private fields */ }Expand description
Collects everything one Orchestrator needs.
Implementations§
Source§impl OrchestratorBuilder
impl OrchestratorBuilder
Sourcepub fn new() -> OrchestratorBuilder
pub fn new() -> OrchestratorBuilder
An empty builder with the conservative configuration.
Sourcepub fn workflows(self, workflows: Arc<WorkflowRegistry>) -> OrchestratorBuilder
pub fn workflows(self, workflows: Arc<WorkflowRegistry>) -> OrchestratorBuilder
The workflows this runtime hosts.
Sourcepub fn providers(self, providers: Arc<ProviderPool>) -> OrchestratorBuilder
pub fn providers(self, providers: Arc<ProviderPool>) -> OrchestratorBuilder
The configured providers.
Sourcepub fn stores(self, stores: Stores) -> OrchestratorBuilder
pub fn stores(self, stores: Stores) -> OrchestratorBuilder
The persistence layer.
Sourcepub fn consequences(
self,
consequences: Arc<dyn TurnConsequences>,
) -> OrchestratorBuilder
pub fn consequences( self, consequences: Arc<dyn TurnConsequences>, ) -> OrchestratorBuilder
Declares what a turn’s writes imply on other cases. See TurnConsequences.
Sourcepub fn case_directory(
self,
directory: Arc<dyn CaseDirectory>,
) -> OrchestratorBuilder
pub fn case_directory( self, directory: Arc<dyn CaseDirectory>, ) -> OrchestratorBuilder
The directory of addressable cases.
Sourcepub fn knowledge(
self,
knowledge: Arc<dyn KnowledgeProvider>,
) -> OrchestratorBuilder
pub fn knowledge( self, knowledge: Arc<dyn KnowledgeProvider>, ) -> OrchestratorBuilder
The knowledge provider answers may rest on (spec §19.2).
Sourcepub fn attachments(
self,
source: Arc<dyn AttachmentSource>,
) -> OrchestratorBuilder
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.
Sourcepub fn policy(self, policy: PolicySnapshot) -> OrchestratorBuilder
pub fn policy(self, policy: PolicySnapshot) -> OrchestratorBuilder
The policy snapshot commands are judged against (spec §14.3).
Sourcepub fn observer(self, observer: Arc<dyn Observer>) -> OrchestratorBuilder
pub fn observer(self, observer: Arc<dyn Observer>) -> OrchestratorBuilder
Where metrics go (spec §26.2).
Sourcepub fn mode(self, mode: OrchestrationMode) -> OrchestratorBuilder
pub fn mode(self, mode: OrchestrationMode) -> OrchestratorBuilder
How much autonomy the model gets (spec §11.1). Refused beside
Self::config; see BuildError::ConflictingMode.
Sourcepub fn config(self, config: OrchestratorConfig) -> OrchestratorBuilder
pub fn config(self, config: OrchestratorConfig) -> OrchestratorBuilder
The whole configuration, mode included. Refused beside Self::mode.
Sourcepub fn clock(self, clock: Arc<dyn TurnClock>) -> OrchestratorBuilder
pub fn clock(self, clock: Arc<dyn TurnClock>) -> OrchestratorBuilder
Replaces the runtime clock.
Sourcepub fn case_id_factory(
self,
factory: Arc<dyn CaseIdFactory>,
) -> OrchestratorBuilder
pub fn case_id_factory( self, factory: Arc<dyn CaseIdFactory>, ) -> OrchestratorBuilder
Replaces the factory that mints identifiers for new cases.
Sourcepub fn understander(
self,
understander: Arc<dyn TurnUnderstander>,
) -> OrchestratorBuilder
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.
Sourcepub fn prompt_source(self, source: Arc<dyn PromptSource>) -> OrchestratorBuilder
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.
Sourcepub fn prompt_selector(self, selector: PromptSelector) -> OrchestratorBuilder
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.
Sourcepub fn composer(self, composer: Composer) -> OrchestratorBuilder
pub fn composer(self, composer: Composer) -> OrchestratorBuilder
Replaces the composition stage.
Sourcepub fn notice_copy(self, copy: NoticeCopy) -> OrchestratorBuilder
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.
Sourcepub fn attachment_copy(self, copy: AttachmentCopy) -> OrchestratorBuilder
pub fn attachment_copy(self, copy: AttachmentCopy) -> OrchestratorBuilder
Replaces what a user is told about a file the model was not shown.
Sourcepub fn locales<L>(
self,
locales: impl IntoIterator<Item = L>,
) -> OrchestratorBuilder
pub fn locales<L>( self, locales: impl IntoIterator<Item = L>, ) -> OrchestratorBuilder
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.
Sourcepub fn confirmation_copy(self, copy: ConfirmationCopy) -> OrchestratorBuilder
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.
Sourcepub fn trace(self, trace: Arc<dyn TurnTrace>) -> OrchestratorBuilder
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.
Sourcepub fn build(self) -> Result<Orchestrator, BuildError>
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
impl Debug for OrchestratorBuilder
Source§impl Default for OrchestratorBuilder
impl Default for OrchestratorBuilder
Source§fn default() -> OrchestratorBuilder
fn default() -> OrchestratorBuilder
Auto Trait Implementations§
impl !RefUnwindSafe for OrchestratorBuilder
impl !UnwindSafe for OrchestratorBuilder
impl Forget for OrchestratorBuilder
impl Freeze for OrchestratorBuilder
impl Move for OrchestratorBuilder
impl Send for OrchestratorBuilder
impl Sync for OrchestratorBuilder
impl Unpin for OrchestratorBuilder
impl UnsafeUnpin for OrchestratorBuilder
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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