pub struct AgentState {
pub session_id: String,
pub steps_count: u32,
pub consecutive_fail_count: u32,
pub final_resp: Option<String>,
}Expand description
agent 在一次运行中的可持久化状态。
注意:工具批次进度不在这里——它属于状态机变体
Agent::ToolExecuting(_, ToolRunState) 的载荷;等待用户输入则由
Agent::WaitingForUser(_, UserInteraction) 显式承载。此处只放跨状态延续的
标量计数与最终回复,避免出现第二份易发散的工具状态。
Fields§
§session_id: String§steps_count: u32§consecutive_fail_count: u32§final_resp: Option<String>Implementations§
Trait Implementations§
Source§impl Clone for AgentState
impl Clone for AgentState
Source§fn clone(&self) -> AgentState
fn clone(&self) -> AgentState
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 AgentState
impl Debug for AgentState
Source§impl<'de> Deserialize<'de> for AgentState
impl<'de> Deserialize<'de> for AgentState
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 AgentState
impl RefUnwindSafe for AgentState
impl Send for AgentState
impl Sync for AgentState
impl Unpin for AgentState
impl UnsafeUnpin for AgentState
impl UnwindSafe 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