pub struct PluginEngine { /* private fields */ }Expand description
Plugin execution engine.
Manages plugin lifecycle and execution order.
Implementations§
Source§impl PluginEngine
impl PluginEngine
Sourcepub async fn resolve_model(
&self,
model_id: &str,
ctx: &RequestContext,
) -> Result<String, AiError>
pub async fn resolve_model( &self, model_id: &str, ctx: &RequestContext, ) -> Result<String, AiError>
Run a first hook (returns on first Some)
Sourcepub async fn load_template(
&self,
template_name: &str,
ctx: &RequestContext,
) -> Result<Option<Vec<Message>>, AiError>
pub async fn load_template( &self, template_name: &str, ctx: &RequestContext, ) -> Result<Option<Vec<Message>>, AiError>
Load template
Sourcepub async fn transform_params(
&self,
params: TextParams,
ctx: &RequestContext,
) -> Result<TextParams, AiError>
pub async fn transform_params( &self, params: TextParams, ctx: &RequestContext, ) -> Result<TextParams, AiError>
Run sequential transform_params hooks
Sourcepub async fn transform_result(
&self,
result: TextResult,
ctx: &RequestContext,
) -> Result<TextResult, AiError>
pub async fn transform_result( &self, result: TextResult, ctx: &RequestContext, ) -> Result<TextResult, AiError>
Run sequential transform_result hooks
Sourcepub async fn on_request_start(
&self,
ctx: &RequestContext,
) -> Result<(), AiError>
pub async fn on_request_start( &self, ctx: &RequestContext, ) -> Result<(), AiError>
Run parallel on_request_start hooks
Sourcepub async fn on_request_end(
&self,
ctx: &RequestContext,
result: &TextResult,
) -> Result<(), AiError>
pub async fn on_request_end( &self, ctx: &RequestContext, result: &TextResult, ) -> Result<(), AiError>
Run parallel on_request_end hooks
Sourcepub async fn on_error(
&self,
error: &AiError,
ctx: &RequestContext,
) -> Result<(), AiError>
pub async fn on_error( &self, error: &AiError, ctx: &RequestContext, ) -> Result<(), AiError>
Run parallel on_error hooks
Sourcepub fn apply_stream_transforms(
&self,
stream: Box<TextStream>,
) -> Box<TextStream>
pub fn apply_stream_transforms( &self, stream: Box<TextStream>, ) -> Box<TextStream>
Apply stream transformations
Trait Implementations§
Source§impl Clone for PluginEngine
impl Clone for PluginEngine
Source§fn clone(&self) -> PluginEngine
fn clone(&self) -> PluginEngine
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PluginEngine
impl Debug for PluginEngine
Auto Trait Implementations§
impl Freeze for PluginEngine
impl !RefUnwindSafe for PluginEngine
impl Send for PluginEngine
impl Sync for PluginEngine
impl Unpin for PluginEngine
impl !UnwindSafe for PluginEngine
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