pub struct Agent<I, T, Ms, Sk>{
pub id: AgentId,
pub model: String,
pub instructions: I,
pub tools: T,
pub memory: Ms,
pub skills: Sk,
pub inference: Arc<dyn InferenceClient>,
pub bus: EventBus,
pub max_tool_iterations: u32,
}Expand description
Generic agent. Strategy types are monomorphized for the hot
path; a BoxedAgent form (using Box<dyn> for each slot) is
produced from AgentSpec.
Fields§
§id: AgentId§model: String§instructions: I§tools: T§memory: Ms§skills: Sk§inference: Arc<dyn InferenceClient>§bus: EventBus§max_tool_iterations: u32Implementations§
Source§impl<I, T, Ms, Sk> Agent<I, T, Ms, Sk>
impl<I, T, Ms, Sk> Agent<I, T, Ms, Sk>
Sourcepub async fn run_turn(
&self,
user: String,
budgets: AgentBudgets,
) -> Result<TurnResult>
pub async fn run_turn( &self, user: String, budgets: AgentBudgets, ) -> Result<TurnResult>
One full agent turn. Drives the per-turn pipeline (memory + skill + tool resolution → instruction render → context assembly → inference → tool-call loop → memory store).
Thin wrapper around [run_turn_impl]; the typed Agent<I,T,Ms,Sk>
stays monomorphic at the call site, only crossing into
dyn-dispatch at the run_turn_impl boundary.
Auto Trait Implementations§
impl<I, T, Ms, Sk> Freeze for Agent<I, T, Ms, Sk>
impl<I, T, Ms, Sk> !RefUnwindSafe for Agent<I, T, Ms, Sk>
impl<I, T, Ms, Sk> Send for Agent<I, T, Ms, Sk>
impl<I, T, Ms, Sk> Sync for Agent<I, T, Ms, Sk>
impl<I, T, Ms, Sk> Unpin for Agent<I, T, Ms, Sk>
impl<I, T, Ms, Sk> UnsafeUnpin for Agent<I, T, Ms, Sk>
impl<I, T, Ms, Sk> !UnwindSafe for Agent<I, T, Ms, Sk>
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