pub struct AgentState {
pub model: Model,
pub thinking_level: ThinkingLevel,
pub tools: Vec<Arc<dyn AgentTool>>,
pub messages: Vec<AgentMessage>,
pub is_streaming: bool,
pub streaming_message: Option<AgentMessage>,
pub pending_tool_calls: IndexSet<String>,
pub error_message: Option<String>,
}Expand description
Snapshot of the agent state.
Fields§
§model: ModelModel of the next request.
thinking_level: ThinkingLevelThinking level of the next request.
tools: Vec<Arc<dyn AgentTool>>Executable tools.
messages: Vec<AgentMessage>Transcript.
is_streaming: boolA run is active.
streaming_message: Option<AgentMessage>The message currently streaming.
pending_tool_calls: IndexSet<String>Tool calls started but not settled, in start order.
error_message: Option<String>Error of the last failed turn.
Implementations§
Source§impl AgentState
impl AgentState
Sourcepub fn system_prompt(&self) -> String
pub fn system_prompt(&self) -> String
The replayed prompt text of the transcript.
Trait Implementations§
Source§impl Clone for AgentState
impl Clone for AgentState
Auto Trait Implementations§
impl !RefUnwindSafe for AgentState
impl !UnwindSafe for AgentState
impl Freeze for AgentState
impl Send for AgentState
impl Sync for AgentState
impl Unpin for AgentState
impl UnsafeUnpin for AgentState
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