pub trait ChatEngineBackendPlugin: Send + Sync {
// Required method
fn plugin_instance_id(&self) -> &str;
// Provided methods
fn on_session_type_configured<'life0, 'async_trait>(
&'life0 self,
_ctx: SessionPluginCtx,
) -> Pin<Box<dyn Future<Output = Result<SessionPluginResponse, PluginError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait { ... }
fn on_session_created<'life0, 'async_trait>(
&'life0 self,
_ctx: SessionPluginCtx,
) -> Pin<Box<dyn Future<Output = Result<SessionPluginResponse, PluginError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait { ... }
fn on_session_updated<'life0, 'async_trait>(
&'life0 self,
_ctx: SessionPluginCtx,
) -> Pin<Box<dyn Future<Output = Result<SessionPluginResponse, PluginError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait { ... }
fn on_message<'life0, 'async_trait>(
&'life0 self,
_ctx: MessagePluginCtx,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<StreamingEvent, PluginError>> + Send>>, PluginError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait { ... }
fn on_message_recreate<'life0, 'async_trait>(
&'life0 self,
_ctx: MessagePluginCtx,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<StreamingEvent, PluginError>> + Send>>, PluginError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait { ... }
fn on_session_summary<'life0, 'async_trait>(
&'life0 self,
_ctx: SessionPluginCtx,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<StreamingEvent, PluginError>> + Send>>, PluginError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait { ... }
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<HealthStatus, PluginError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait { ... }
}Required Methods§
fn plugin_instance_id(&self) -> &str
Provided Methods§
fn on_session_type_configured<'life0, 'async_trait>(
&'life0 self,
_ctx: SessionPluginCtx,
) -> Pin<Box<dyn Future<Output = Result<SessionPluginResponse, PluginError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn on_session_created<'life0, 'async_trait>(
&'life0 self,
_ctx: SessionPluginCtx,
) -> Pin<Box<dyn Future<Output = Result<SessionPluginResponse, PluginError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn on_session_updated<'life0, 'async_trait>(
&'life0 self,
_ctx: SessionPluginCtx,
) -> Pin<Box<dyn Future<Output = Result<SessionPluginResponse, PluginError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Sourcefn on_message<'life0, 'async_trait>(
&'life0 self,
_ctx: MessagePluginCtx,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<StreamingEvent, PluginError>> + Send>>, PluginError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn on_message<'life0, 'async_trait>(
&'life0 self,
_ctx: MessagePluginCtx,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<StreamingEvent, PluginError>> + Send>>, PluginError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Process a new user message and stream response events back.
The outer Result reports failures before streaming starts (e.g., auth
failure). Once a stream is returned, individual items may be Err to
signal mid-stream failures (e.g., upstream disconnect).
The returned PluginStream must be 'static — it cannot borrow from
&self. See PluginStream’s docs for the idiomatic way to detach
captured state (clone fields out, or hold self in an Arc).
Sourcefn on_message_recreate<'life0, 'async_trait>(
&'life0 self,
_ctx: MessagePluginCtx,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<StreamingEvent, PluginError>> + Send>>, PluginError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn on_message_recreate<'life0, 'async_trait>(
&'life0 self,
_ctx: MessagePluginCtx,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<StreamingEvent, PluginError>> + Send>>, PluginError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Regenerate a response for an existing user message (new variant).
Same streaming semantics as on_message.
Sourcefn on_session_summary<'life0, 'async_trait>(
&'life0 self,
_ctx: SessionPluginCtx,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<StreamingEvent, PluginError>> + Send>>, PluginError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn on_session_summary<'life0, 'async_trait>(
&'life0 self,
_ctx: SessionPluginCtx,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<StreamingEvent, PluginError>> + Send>>, PluginError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Generate a session summary and stream the result back.
Summary plugins typically emit one or more Chunk events followed by a
Complete event carrying metadata.
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<HealthStatus, PluginError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".