Skip to main content

meerkat_core/agent/
comms_impl.rs

1//! Agent comms helpers.
2
3use crate::agent::{Agent, AgentLlmClient, AgentSessionStore, AgentToolDispatcher, CommsRuntime};
4
5impl<C, T, S> Agent<C, T, S>
6where
7    C: AgentLlmClient + ?Sized + 'static,
8    T: AgentToolDispatcher + ?Sized + 'static,
9    S: AgentSessionStore + ?Sized + 'static,
10{
11    /// Get the comms runtime, if enabled.
12    pub fn comms(&self) -> Option<&dyn CommsRuntime> {
13        self.comms_runtime.as_deref()
14    }
15
16    /// Get a shared handle to the comms runtime, if enabled.
17    pub fn comms_arc(&self) -> Option<std::sync::Arc<dyn CommsRuntime>> {
18        self.comms_runtime.clone()
19    }
20}