pub struct OpsRuntimeBuilder { /* private fields */ }Expand description
Builder accumulator.
Implementations§
Source§impl OpsRuntimeBuilder
impl OpsRuntimeBuilder
Sourcepub fn tenant_resolver(self, r: Arc<dyn TenantResolver>) -> Self
pub fn tenant_resolver(self, r: Arc<dyn TenantResolver>) -> Self
Set the tenant resolver. Required before calling spawn.
Sourcepub fn redactor(self, r: SharedRedactor) -> Self
pub fn redactor(self, r: SharedRedactor) -> Self
Override the default redactor.
Sourcepub fn clock(self, c: SharedClock) -> Self
pub fn clock(self, c: SharedClock) -> Self
Override the default clock.
Sourcepub fn agent_id(self, id: AgentId) -> Self
pub fn agent_id(self, id: AgentId) -> Self
Override the agent identity recorded in
crate::OpsEvent::SupervisorStateChange. Defaults to the inner
agent’s klieo_core::Agent::name when not supplied.
Sourcepub fn governor(self, g: Arc<dyn Governor>) -> Self
pub fn governor(self, g: Arc<dyn Governor>) -> Self
Register a crate::governor::Governor that rate-limits LLM calls made by the
wrapped agent.
Sourcepub fn governor_provider(self, p: ProviderId) -> Self
pub fn governor_provider(self, p: ProviderId) -> Self
Set the provider tag recorded in crate::OpsEvent::GovernorDenial events.
Defaults to "default" when not supplied.
Sourcepub fn escalation(self, e: Arc<dyn Escalation>) -> Self
pub fn escalation(self, e: Arc<dyn Escalation>) -> Self
Register an Escalation impl. Required when any registered gate
may emit RequireApproval.
Sourcepub fn gate(self, gate: Arc<dyn Gate>) -> Self
pub fn gate(self, gate: Arc<dyn Gate>) -> Self
Register a crate::gates::Gate that guards every tool invocation made by the
wrapped agent.
Sourcepub fn approval_timeout(self, timeout: Duration) -> Self
pub fn approval_timeout(self, timeout: Duration) -> Self
Override the approval timeout passed to crate::runtime::gated_invoker::GatedToolInvoker.
How long GatedToolInvoker waits for a gate’s wait_for_approval
to resolve before returning klieo_core::ToolError::Permanent. Defaults to
600 seconds (10 minutes) per spec § 2.3.
Sourcepub fn approval_timeout_policy(self, policy: ApprovalTimeoutPolicy) -> Self
pub fn approval_timeout_policy(self, policy: ApprovalTimeoutPolicy) -> Self
Override the policy applied when wait_for_approval times out.
Defaults to RequeueAndEscalate { max_requeues: 3 } per spec § 2.3.
Use ApprovalTimeoutPolicy::Deny to restore the pre-v0.4 behaviour
(terminate immediately on the first timeout).
Sourcepub fn spawn<A>(self, agent: A) -> Result<SupervisedAgent<A>, BuildError>where
A: Agent,
pub fn spawn<A>(self, agent: A) -> Result<SupervisedAgent<A>, BuildError>where
A: Agent,
Validate configuration and wrap the agent.
Returns BuildError::MissingDependency when a required dependency
is absent:
tenant_resolverwas not supplied.- Any registered gate has
may_require_approval == truebut noEscalationwas configured.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for OpsRuntimeBuilder
impl !UnwindSafe for OpsRuntimeBuilder
impl Freeze for OpsRuntimeBuilder
impl Send for OpsRuntimeBuilder
impl Sync for OpsRuntimeBuilder
impl Unpin for OpsRuntimeBuilder
impl UnsafeUnpin for OpsRuntimeBuilder
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> 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