pub struct Session { /* private fields */ }Implementations§
Source§impl Session
impl Session
pub async fn new( services: RuntimeServices, session_id: &str, ) -> Result<Self, SessionError>
pub fn session_id(&self) -> &str
pub fn tools(&self) -> Arc<dyn ToolProvider> ⓘ
pub fn plugins(&self) -> &Arc<PluginSession> ⓘ
pub fn set_context_surface( &mut self, tool_providers: Vec<Arc<dyn ToolProvider>>, prompt_contributions: Vec<PromptContribution>, include_base_tools: bool, ) -> Result<(), PluginError>
pub fn prompt_cache(&self) -> Arc<PromptCache> ⓘ
pub fn context_prompt_contributions(&self) -> &[PromptContribution]
pub fn history_store(&self) -> Option<Arc<dyn RuntimePersistence>>
pub fn tool_surface( &self, session_id: &str, ) -> Result<Arc<ToolSurface>, PluginError>
pub fn tool_catalog(&self, session_id: &str) -> Result<Vec<Value>, PluginError>
Sourcepub fn set_message_sender(&mut self, tx: UnboundedSender<SandboxMessage>)
pub fn set_message_sender(&mut self, tx: UnboundedSender<SandboxMessage>)
Set the message sender for streaming messages during execution.
Sourcepub fn clear_message_sender(&mut self)
pub fn clear_message_sender(&mut self)
Clear the message sender (drops the sender, causing receivers to terminate).
pub fn invalidate_runtime_caches(&self)
pub async fn refresh_tool_surface(&mut self) -> Result<(), SessionError>
Auto Trait Implementations§
impl !Freeze for Session
impl !RefUnwindSafe for Session
impl !UnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnsafeUnpin for Session
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