pub struct EphemeralAgent { /* private fields */ }Expand description
Ephemeral agent for federated learning
Collects trajectories during its session and exports state before termination.
Implementations§
Source§impl EphemeralAgent
impl EphemeralAgent
Sourcepub fn new(agent_id: impl Into<String>, config: SonaConfig) -> Self
pub fn new(agent_id: impl Into<String>, config: SonaConfig) -> Self
Create a new ephemeral agent
Sourcepub fn default_federated(agent_id: impl Into<String>, hidden_dim: usize) -> Self
pub fn default_federated(agent_id: impl Into<String>, hidden_dim: usize) -> Self
Create with default config for federated learning
Sourcepub fn engine(&self) -> &SonaEngine
pub fn engine(&self) -> &SonaEngine
Get engine reference
Sourcepub fn engine_mut(&mut self) -> &mut SonaEngine
pub fn engine_mut(&mut self) -> &mut SonaEngine
Get mutable engine reference
Sourcepub fn process_trajectory(
&mut self,
embedding: Vec<f32>,
activations: Vec<f32>,
quality: f32,
route: Option<String>,
context: Vec<String>,
)
pub fn process_trajectory( &mut self, embedding: Vec<f32>, activations: Vec<f32>, quality: f32, route: Option<String>, context: Vec<String>, )
Process a task and record trajectory
Sourcepub fn apply_micro_lora(&self, input: &[f32], output: &mut [f32])
pub fn apply_micro_lora(&self, input: &[f32], output: &mut [f32])
Apply micro-LoRA to hidden states
Sourcepub fn trajectory_count(&self) -> usize
pub fn trajectory_count(&self) -> usize
Get number of collected trajectories
Sourcepub fn avg_quality(&self) -> f32
pub fn avg_quality(&self) -> f32
Get average quality
Sourcepub fn force_learn(&self) -> String
pub fn force_learn(&self) -> String
Force local learning
Sourcepub fn process_task(&mut self, embedding: Vec<f32>, quality: f32)
pub fn process_task(&mut self, embedding: Vec<f32>, quality: f32)
Simple process task method
Sourcepub fn process_task_with_route(
&mut self,
embedding: Vec<f32>,
quality: f32,
route: &str,
)
pub fn process_task_with_route( &mut self, embedding: Vec<f32>, quality: f32, route: &str, )
Process task with route information
Sourcepub fn average_quality(&self) -> f32
pub fn average_quality(&self) -> f32
Get average quality (alias for avg_quality)
Sourcepub fn uptime_seconds(&self) -> u64
pub fn uptime_seconds(&self) -> u64
Get uptime in seconds
Sourcepub fn stats(&self) -> AgentExportStats
pub fn stats(&self) -> AgentExportStats
Get agent stats
Sourcepub fn get_patterns(&self) -> Vec<LearnedPattern>
pub fn get_patterns(&self) -> Vec<LearnedPattern>
Get learned patterns from agent
Sourcepub fn export_state(&self) -> AgentExport
pub fn export_state(&self) -> AgentExport
Export agent state for federation
Call this before terminating the agent.
Auto Trait Implementations§
impl !Freeze for EphemeralAgent
impl !RefUnwindSafe for EphemeralAgent
impl Send for EphemeralAgent
impl Sync for EphemeralAgent
impl Unpin for EphemeralAgent
impl !UnwindSafe for EphemeralAgent
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