pub struct PluggableProvider { /* private fields */ }Expand description
A Provider backed by a plugin’s sync ProviderRequestFn.
See the module docs for the v1 one-shot streaming model + the request/response
envelope. Built from a loaded ExtensionSession; one PluggableProvider
per RegisteredProvider in the session’s snapshot.
Implementations§
Source§impl PluggableProvider
impl PluggableProvider
Sourcepub fn from_session(
session: &ExtensionSession,
runtime: Handle,
) -> Vec<Arc<dyn Provider>>
pub fn from_session( session: &ExtensionSession, runtime: Handle, ) -> Vec<Arc<dyn Provider>>
Build one PluggableProvider per registered provider in the session’s
snapshot, as Arc<dyn Provider>. Returns an empty vec when no plugin
registered a provider (so a session without provider plugins injects
nothing). The Handle MUST be captured from a thread running the target
runtime (pi-cli builds providers on the async main thread, same as the
ActionBridge).
Trait Implementations§
Source§impl Provider for PluggableProvider
impl Provider for PluggableProvider
Source§fn stream_simple<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
model: &'life1 Model,
ctx: &'life2 Context,
opts: &'life3 SimpleStreamOptions,
) -> Pin<Box<dyn Future<Output = AssistantMessageEventStream> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn stream_simple<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
model: &'life1 Model,
ctx: &'life2 Context,
opts: &'life3 SimpleStreamOptions,
) -> Pin<Box<dyn Future<Output = AssistantMessageEventStream> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Stream a single assistant turn against
ctx on model. Returns the
consumer end of an event stream; the producer task is already running.Auto Trait Implementations§
impl !RefUnwindSafe for PluggableProvider
impl !UnwindSafe for PluggableProvider
impl Freeze for PluggableProvider
impl Send for PluggableProvider
impl Sync for PluggableProvider
impl Unpin for PluggableProvider
impl UnsafeUnpin for PluggableProvider
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