pub enum AgentFinishReason {
Completed,
UserAbort,
MaxSteps,
TokenBudget,
Error,
Timeout,
}Expand description
Agent 运行结束原因。
区别于 FinishReason(LLM 单步停止原因),AgentFinishReason
描述整个 Agent loop 的终止原因。
§Examples
use katu_core::agent_event::AgentFinishReason;
let reason = AgentFinishReason::Completed;
let json = serde_json::to_string(&reason).unwrap();
assert_eq!(json, r#""completed""#);Variants§
Completed
正常完成 — LLM 在最终步骤返回 end_turn 且无待处理的 tool call。
UserAbort
用户中断。
MaxSteps
达到最大步数限制。
TokenBudget
达到 token 预算上限。
Error
不可恢复错误导致终止。
Timeout
超时。
Trait Implementations§
Source§impl Clone for AgentFinishReason
impl Clone for AgentFinishReason
Source§fn clone(&self) -> AgentFinishReason
fn clone(&self) -> AgentFinishReason
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 AgentFinishReason
impl Debug for AgentFinishReason
Source§impl<'de> Deserialize<'de> for AgentFinishReason
impl<'de> Deserialize<'de> for AgentFinishReason
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
Source§impl Display for AgentFinishReason
impl Display for AgentFinishReason
Source§impl PartialEq for AgentFinishReason
impl PartialEq for AgentFinishReason
Source§fn eq(&self, other: &AgentFinishReason) -> bool
fn eq(&self, other: &AgentFinishReason) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for AgentFinishReason
impl Serialize for AgentFinishReason
impl Eq for AgentFinishReason
impl StructuralPartialEq for AgentFinishReason
Auto Trait Implementations§
impl Freeze for AgentFinishReason
impl RefUnwindSafe for AgentFinishReason
impl Send for AgentFinishReason
impl Sync for AgentFinishReason
impl Unpin for AgentFinishReason
impl UnsafeUnpin for AgentFinishReason
impl UnwindSafe for AgentFinishReason
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