pub struct AgentStateSnapshot {
pub system_prompt: String,
pub model: Model,
pub thinking_level: ThinkingLevel,
pub messages: Vec<AgentMessage>,
pub is_streaming: bool,
pub stream_message: Option<AgentMessage>,
pub pending_tool_calls: HashSet<String>,
pub error: Option<String>,
pub message_count: usize,
pub max_messages: usize,
}Expand description
A consistent, lock-free snapshot of the agent’s full state.
Includes both runtime state (from AgentState) and configuration
(model, thinking_level from [AgentConfig]).
Obtain via [Agent::snapshot()].
Fields§
§system_prompt: StringSystem prompt.
model: ModelCurrent model (from AgentConfig).
thinking_level: ThinkingLevelThinking level (from AgentConfig).
messages: Vec<AgentMessage>Conversation messages.
is_streaming: boolWhether currently streaming.
stream_message: Option<AgentMessage>Current streaming message.
pending_tool_calls: HashSet<String>Pending tool call IDs.
error: Option<String>Last error.
message_count: usizeMessage count.
max_messages: usizeMax messages limit (0 = unlimited).
Trait Implementations§
Source§impl Clone for AgentStateSnapshot
impl Clone for AgentStateSnapshot
Source§fn clone(&self) -> AgentStateSnapshot
fn clone(&self) -> AgentStateSnapshot
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AgentStateSnapshot
impl Debug for AgentStateSnapshot
Source§impl<'de> Deserialize<'de> for AgentStateSnapshot
impl<'de> Deserialize<'de> for AgentStateSnapshot
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AgentStateSnapshot
impl RefUnwindSafe for AgentStateSnapshot
impl Send for AgentStateSnapshot
impl Sync for AgentStateSnapshot
impl Unpin for AgentStateSnapshot
impl UnsafeUnpin for AgentStateSnapshot
impl UnwindSafe for AgentStateSnapshot
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