pub struct Checkpoint {
pub id: String,
pub run_id: RunId,
pub graph_id: Option<GraphId>,
pub current_node: Option<String>,
pub state: Value,
pub messages: Vec<MessageRecord>,
pub tool_results: HashMap<String, Value>,
pub created_at: DateTime<Utc>,
pub metadata: HashMap<String, Value>,
}Expand description
Checkpoint - saved state of execution
Fields§
§id: StringUnique checkpoint ID
run_id: RunIdRun this checkpoint belongs to
graph_id: Option<GraphId>Graph being executed
current_node: Option<String>Current node in execution
state: ValueState at this checkpoint
messages: Vec<MessageRecord>Messages history (for LLM agents)
tool_results: HashMap<String, Value>Tool results collected so far
created_at: DateTime<Utc>Created timestamp
metadata: HashMap<String, Value>Metadata
Implementations§
Source§impl Checkpoint
impl Checkpoint
Sourcepub fn with_state(self, state: Value) -> Self
pub fn with_state(self, state: Value) -> Self
Set the current state
Sourcepub fn add_message(
&mut self,
role: impl Into<String>,
content: impl Into<String>,
)
pub fn add_message( &mut self, role: impl Into<String>, content: impl Into<String>, )
Add a message to history
Sourcepub fn add_tool_result(&mut self, tool_name: impl Into<String>, result: Value)
pub fn add_tool_result(&mut self, tool_name: impl Into<String>, result: Value)
Add a tool result
Sourcepub fn with_agent_name(self, name: impl Into<String>) -> Self
pub fn with_agent_name(self, name: impl Into<String>) -> Self
Set the agent name in metadata
Sourcepub fn agent_name(&self) -> Option<&str>
pub fn agent_name(&self) -> Option<&str>
Get the agent name from metadata
Trait Implementations§
Source§impl Clone for Checkpoint
impl Clone for Checkpoint
Source§fn clone(&self) -> Checkpoint
fn clone(&self) -> Checkpoint
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 Checkpoint
impl Debug for Checkpoint
Source§impl<'de> Deserialize<'de> for Checkpoint
impl<'de> Deserialize<'de> for Checkpoint
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 Checkpoint
impl RefUnwindSafe for Checkpoint
impl Send for Checkpoint
impl Sync for Checkpoint
impl Unpin for Checkpoint
impl UnsafeUnpin for Checkpoint
impl UnwindSafe for Checkpoint
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