pub trait Toolkit<TCtx>: Send + Sync {
// Required method
fn create_session<'a>(
&'a self,
context: &'a TCtx,
) -> BoxFuture<'a, Result<Box<dyn ToolkitSession<TCtx> + Send + Sync>, BoxedError>>;
}Expand description
Toolkit produces a per-session toolkit session that can provide dynamic prompt and tool data.
Required Methods§
Sourcefn create_session<'a>(
&'a self,
context: &'a TCtx,
) -> BoxFuture<'a, Result<Box<dyn ToolkitSession<TCtx> + Send + Sync>, BoxedError>>
fn create_session<'a>( &'a self, context: &'a TCtx, ) -> BoxFuture<'a, Result<Box<dyn ToolkitSession<TCtx> + Send + Sync>, BoxedError>>
Create a new toolkit session for the supplied context value. Implementations should also initialize the session with instructions and tools.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".