pub struct OrchestratorBuilder { /* private fields */ }Expand description
Collects everything one Orchestrator needs.
Implementations§
Source§impl OrchestratorBuilder
impl OrchestratorBuilder
Sourcepub fn workflows(self, workflows: Arc<WorkflowRegistry>) -> Self
pub fn workflows(self, workflows: Arc<WorkflowRegistry>) -> Self
The workflows this runtime hosts.
Sourcepub fn providers(self, providers: Arc<ProviderPool>) -> Self
pub fn providers(self, providers: Arc<ProviderPool>) -> Self
The configured providers.
Sourcepub fn consequences(self, consequences: Arc<dyn TurnConsequences>) -> Self
pub fn consequences(self, consequences: Arc<dyn TurnConsequences>) -> Self
Declares what a turn’s writes imply on other cases. See TurnConsequences.
Sourcepub fn case_directory(self, directory: Arc<dyn CaseDirectory>) -> Self
pub fn case_directory(self, directory: Arc<dyn CaseDirectory>) -> Self
The directory of addressable cases.
Sourcepub fn knowledge(self, knowledge: Arc<dyn KnowledgeProvider>) -> Self
pub fn knowledge(self, knowledge: Arc<dyn KnowledgeProvider>) -> Self
The knowledge provider answers may rest on (spec §19.2).
Sourcepub fn attachments(self, source: Arc<dyn AttachmentSource>) -> Self
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.
Sourcepub fn policy(self, policy: PolicySnapshot) -> Self
pub fn policy(self, policy: PolicySnapshot) -> Self
The policy snapshot commands are judged against (spec §14.3).
Sourcepub fn mode(self, mode: OrchestrationMode) -> Self
pub fn mode(self, mode: OrchestrationMode) -> Self
How much autonomy the model gets (spec §11.1). Refused beside
Self::config; see BuildError::ConflictingMode.
Sourcepub fn config(self, config: OrchestratorConfig) -> Self
pub fn config(self, config: OrchestratorConfig) -> Self
The whole configuration, mode included. Refused beside Self::mode.
Sourcepub fn case_id_factory(self, factory: Arc<dyn CaseIdFactory>) -> Self
pub fn case_id_factory(self, factory: Arc<dyn CaseIdFactory>) -> Self
Replaces the factory that mints identifiers for new cases.
Sourcepub fn understander(self, understander: Arc<dyn TurnUnderstander>) -> Self
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.
Sourcepub fn prompt_source(self, source: Arc<dyn PromptSource>) -> Self
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.
Sourcepub fn prompt_selector(self, selector: PromptSelector) -> Self
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.
Sourcepub fn notice_copy(self, copy: NoticeCopy) -> Self
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.
Sourcepub fn attachment_copy(self, copy: AttachmentCopy) -> Self
pub fn attachment_copy(self, copy: AttachmentCopy) -> Self
Replaces what a user is told about a file the model was not shown.
Sourcepub fn locales<L: Into<Locale>>(
self,
locales: impl IntoIterator<Item = L>,
) -> Self
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.
Sourcepub fn confirmation_copy(self, copy: ConfirmationCopy) -> Self
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.
Sourcepub fn trace(self, trace: Arc<dyn TurnTrace>) -> Self
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.
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.