pub struct ExtensionProviderHooks { /* private fields */ }Expand description
A ProviderHooks that dispatches to the registered extension handlers.
Keeps the cdylib mappings alive via the keepalive (the handler fn pointers
live inside the plugins).
Implementations§
Source§impl ExtensionProviderHooks
impl ExtensionProviderHooks
Sourcepub fn from_session(session: &ExtensionSession) -> Option<Self>
pub fn from_session(session: &ExtensionSession) -> Option<Self>
Build hooks over a loaded extension session’s registry snapshot. Returns
None when no plugin subscribes to any provider-hook tag (so a session
without provider hooks runs the plain no-op path).
Trait Implementations§
Source§impl ProviderHooks for ExtensionProviderHooks
impl ProviderHooks for ExtensionProviderHooks
Source§fn before_request(
&self,
model: &Model,
_ctx: &Context,
opts: &SimpleStreamOptions,
) -> Option<SimpleStreamOptionsPatch>
fn before_request( &self, model: &Model, _ctx: &Context, opts: &SimpleStreamOptions, ) -> Option<SimpleStreamOptionsPatch>
Fan the planned request out to BeforeProviderRequest +
BeforeProviderHeaders subscribers. Returns None — observer-only in
v1 (the handler ABI has no result channel; see the module docs).
Source§fn after_response(&self, _model: &Model, message: &AssistantMessage)
fn after_response(&self, _model: &Model, message: &AssistantMessage)
Fan the terminal assistant message out to AfterProviderResponse
subscribers.
Auto Trait Implementations§
impl !RefUnwindSafe for ExtensionProviderHooks
impl !UnwindSafe for ExtensionProviderHooks
impl Freeze for ExtensionProviderHooks
impl Send for ExtensionProviderHooks
impl Sync for ExtensionProviderHooks
impl Unpin for ExtensionProviderHooks
impl UnsafeUnpin for ExtensionProviderHooks
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