pub struct SupervisedAgent<A: Agent> { /* private fields */ }Expand description
Wrapper around A: Agent that:
- Resolves a tenant and binds it via
scope_tenantfor the duration ofrun. - Wraps
ctx.llmwith aGovernedLlmClient(private wrapper) when acrate::governor::Governoris configured (governorfeature flag required). - Wraps
ctx.toolswith acrate::runtime::gated_invoker::GatedToolInvokerwhen anycrate::gates::Gates are configured (gatesfeature flag required). - Emits
crate::OpsEvent::SupervisorStateChangearound the inner agent call.
Trait Implementations§
Source§impl<A> Agent for SupervisedAgent<A>
impl<A> Agent for SupervisedAgent<A>
Source§type Error = <A as Agent>::Error
type Error = <A as Agent>::Error
Domain-specific error type. Wrap
crate::Error if you don’t need
a custom one.Source§fn system_prompt(&self) -> &str
fn system_prompt(&self) -> &str
System prompt prepended to the conversation.
Source§fn run<'life0, 'async_trait>(
&'life0 self,
ctx: AgentContext,
input: Self::Input,
) -> Pin<Box<dyn Future<Output = Result<Self::Output, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn run<'life0, 'async_trait>(
&'life0 self,
ctx: AgentContext,
input: Self::Input,
) -> Pin<Box<dyn Future<Output = Result<Self::Output, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Run one turn. Runtime supplies
ctx; agent owns the per-call shape. Read moreAuto Trait Implementations§
impl<A> !RefUnwindSafe for SupervisedAgent<A>
impl<A> !UnwindSafe for SupervisedAgent<A>
impl<A> Freeze for SupervisedAgent<A>where
A: Freeze,
impl<A> Send for SupervisedAgent<A>
impl<A> Sync for SupervisedAgent<A>
impl<A> Unpin for SupervisedAgent<A>where
A: Unpin,
impl<A> UnsafeUnpin for SupervisedAgent<A>where
A: UnsafeUnpin,
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
Mutably borrows from an owned value. Read more
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>
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 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>
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