pub struct RoleRoutingProvider { /* private fields */ }Expand description
Construct it at the composition root (where the agent’s primary provider is
built) via RoleRoutingProvider::new, then hand it to Agent::new in
place of the raw provider.
Implementations§
Source§impl RoleRoutingProvider
impl RoleRoutingProvider
Sourcepub fn new(
default: Arc<dyn Provider>,
registry: Arc<RwLock<RawRwLock, RoleRegistry>>,
) -> RoleRoutingProvider
pub fn new( default: Arc<dyn Provider>, registry: Arc<RwLock<RawRwLock, RoleRegistry>>, ) -> RoleRoutingProvider
Wrap default. Role-selected models delegate to their own provider
(resolved via the global provider registry); anything else — including
an unset or unresolvable role — falls back to default with the
originally-requested model.
Sourcepub fn update_registry(&self, f: impl FnOnce(&mut RoleRegistry))
pub fn update_registry(&self, f: impl FnOnce(&mut RoleRegistry))
Mutate the live role registry (e.g. from the settings UI) so changes
apply to subsequent stream() calls without rewrapping the provider.
Sourcepub fn signals_from_request(
context: &Context,
options: &Option<StreamOptions>,
) -> RoleSignals<'static>
pub fn signals_from_request( context: &Context, options: &Option<StreamOptions>, ) -> RoleSignals<'static>
Build the role signals for a request from its context + options.
explicit_override and current_tool are not derivable from a
stream() call (there is no user pin or tool-execution context at the
LLM-call boundary), so they are left as None; the switching rests on
thinking, token count, and triviality.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for RoleRoutingProvider
impl !UnwindSafe for RoleRoutingProvider
impl Freeze for RoleRoutingProvider
impl Send for RoleRoutingProvider
impl Sync for RoleRoutingProvider
impl Unpin for RoleRoutingProvider
impl UnsafeUnpin for RoleRoutingProvider
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.