pub struct LlmAgent { /* private fields */ }Expand description
An actor that calls an LLM provider and returns completions.
Implementations§
Source§impl LlmAgent
impl LlmAgent
pub fn new(config: ActorConfig, llm_config: LlmConfig) -> Self
Sourcepub fn with_publisher(self, p: EventPublisher) -> Self
pub fn with_publisher(self, p: EventPublisher) -> Self
Attach an EventPublisher for MQTT output.
Trait Implementations§
Source§impl Actor for LlmAgent
impl Actor for LlmAgent
Source§fn state(&self) -> ActorState
fn state(&self) -> ActorState
Return the current lifecycle state.
Source§fn metrics(&self) -> Arc<ActorMetrics>
fn metrics(&self) -> Arc<ActorMetrics>
Return a reference to this actor’s metrics.
Source§fn is_protected(&self) -> bool
fn is_protected(&self) -> bool
Return whether this actor is protected from external kill commands.
Source§fn handle_message<'life0, 'async_trait>(
&'life0 mut self,
message: Message,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_message<'life0, 'async_trait>(
&'life0 mut self,
message: Message,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Called with each incoming message from the mailbox.
Source§fn on_heartbeat<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_heartbeat<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Called on heartbeat tick; default implementation is a no-op.
Source§fn run<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn run<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Drive the actor’s main loop. Read more
Auto Trait Implementations§
impl Freeze for LlmAgent
impl !RefUnwindSafe for LlmAgent
impl Send for LlmAgent
impl Sync for LlmAgent
impl Unpin for LlmAgent
impl !UnwindSafe for LlmAgent
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