#[non_exhaustive]pub struct TurnHost<'a> {
pub session_id: SessionId,
pub definition: &'a AgentDefinition,
pub environment: &'a AgentEnvironment,
pub model: &'a ModelSpec,
pub log: &'a dyn EventLog,
pub history: &'a mut History,
pub cancellation: CancellationToken,
pub input: InputQueue,
}Expand description
Agent composition plus the session-specific resources for one turn.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.session_id: SessionIdSession being advanced.
definition: &'a AgentDefinitionValid behavioral definition being interpreted.
environment: &'a AgentEnvironmentShared execution resources.
model: &'a ModelSpecEffective model after per-turn controls.
log: &'a dyn EventLogDurable event storage.
history: &'a mut HistoryLive projection of durable message history.
cancellation: CancellationTokenCooperative cancellation signal.
input: InputQueueMessages that arrived while this turn was running — see
agentyk_core::input::InputQueue. Empty and inert unless the caller
attached one.
Implementations§
Source§impl<'a> TurnHost<'a>
impl<'a> TurnHost<'a>
Sourcepub fn new(
session_id: SessionId,
definition: &'a AgentDefinition,
environment: &'a AgentEnvironment,
log: &'a dyn EventLog,
history: &'a mut History,
) -> Self
pub fn new( session_id: SessionId, definition: &'a AgentDefinition, environment: &'a AgentEnvironment, log: &'a dyn EventLog, history: &'a mut History, ) -> Self
Construct a host context using the agent’s default model.
Sourcepub fn cancellation(self, token: CancellationToken) -> Self
pub fn cancellation(self, token: CancellationToken) -> Self
Attach the cooperative cancellation signal.
Sourcepub fn input(self, input: InputQueue) -> Self
pub fn input(self, input: InputQueue) -> Self
Attach the queue a caller steers this turn through.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for TurnHost<'a>
impl<'a> !UnwindSafe for TurnHost<'a>
impl<'a> Freeze for TurnHost<'a>
impl<'a> Send for TurnHost<'a>
impl<'a> Sync for TurnHost<'a>
impl<'a> Unpin for TurnHost<'a>
impl<'a> UnsafeUnpin for TurnHost<'a>
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