pub struct AgentRunState {Show 15 fields
pub run_id: RunId,
pub conversation_id: ConversationId,
pub message_history: Vec<ModelMessage>,
pub usage: Usage,
pub run_step: usize,
pub status: RunStatus,
pub output: Option<String>,
pub structured_output: Option<Value>,
pub latest_response: Option<ModelResponse>,
pub pending_tool_calls: Vec<ToolCallPart>,
pub pending_tool_returns: Vec<ToolReturnPart>,
pub pending_approval_tool_returns: Vec<ToolReturnPart>,
pub deferred_tool_returns: Vec<ToolReturnPart>,
pub idle_messages: Vec<String>,
pub metadata: Metadata,
}Expand description
Checkpointable state owned by the graph loop.
Fields§
§run_id: RunIdRun identifier.
conversation_id: ConversationIdConversation identifier.
message_history: Vec<ModelMessage>Canonical model history.
usage: UsageAccumulated usage.
run_step: usizeCompleted model/tool loop steps.
status: RunStatusCurrent status.
output: Option<String>Final text output.
structured_output: Option<Value>Final structured JSON output.
latest_response: Option<ModelResponse>Latest model response awaiting classification.
pending_tool_calls: Vec<ToolCallPart>Tool calls awaiting execution.
pending_tool_returns: Vec<ToolReturnPart>Tool returns awaiting request preparation.
pending_approval_tool_returns: Vec<ToolReturnPart>Tool calls that require approval before execution can proceed.
deferred_tool_returns: Vec<ToolReturnPart>Tool calls deferred to another runtime or durable worker.
idle_messages: Vec<String>Idle messages ready to redirect finalization.
metadata: MetadataRun metadata.
Implementations§
Source§impl AgentRunState
impl AgentRunState
Sourcepub fn new(run_id: RunId, conversation_id: ConversationId) -> Self
pub fn new(run_id: RunId, conversation_id: ConversationId) -> Self
Create empty run state.
Sourcepub fn apply_model_response(&mut self, response: ModelResponse)
pub fn apply_model_response(&mut self, response: ModelResponse)
Apply a model response to state.
Sourcepub fn replace_latest_response(&mut self, response: ModelResponse)
pub fn replace_latest_response(&mut self, response: ModelResponse)
Replace the latest response after lifecycle hooks mutate it.
Trait Implementations§
Source§impl Clone for AgentRunState
impl Clone for AgentRunState
Source§fn clone(&self) -> AgentRunState
fn clone(&self) -> AgentRunState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 AgentRunState
impl Debug for AgentRunState
Source§impl<'de> Deserialize<'de> for AgentRunState
impl<'de> Deserialize<'de> for AgentRunState
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
impl Eq for AgentRunState
Source§impl PartialEq for AgentRunState
impl PartialEq for AgentRunState
Source§fn eq(&self, other: &AgentRunState) -> bool
fn eq(&self, other: &AgentRunState) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for AgentRunState
impl Serialize for AgentRunState
impl StructuralPartialEq for AgentRunState
Auto Trait Implementations§
impl Freeze for AgentRunState
impl RefUnwindSafe for AgentRunState
impl Send for AgentRunState
impl Sync for AgentRunState
impl Unpin for AgentRunState
impl UnsafeUnpin for AgentRunState
impl UnwindSafe for AgentRunState
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