pub enum TrajectoryEventKind {
UserMessage {
text: String,
},
ReasoningStarted {
request: Value,
},
AssistantMessage {
blocks: Vec<ContentBlock>,
},
ToolStarted {
call_id: String,
name: String,
arguments: Value,
},
ToolCompleted {
call_id: String,
name: String,
output: Vec<ContentBlock>,
is_error: bool,
},
Interrupted,
WaitingForUser {
interaction: UserInteraction,
},
Failed {
kind: String,
message: String,
},
Succeeded {
final_resp: Option<String>,
},
}Expand description
事件种类。序列化为 { "type": "user_message", ... },方便前端按 tag 分发。
Variants§
UserMessage
用户向会话提交了一条消息(submit 入口)。轨迹的对话起点。
ReasoningStarted
一次推理开始(provider 即将被调用)。
request 为 composer + middleware 之后,由 provider 投影出的请求快照。
AssistantMessage
一条 assistant 消息已成型并落库(含 thinking / text / tool_use 块)。
Fields
§
blocks: Vec<ContentBlock>ToolStarted
某个工具开始执行。
ToolCompleted
某个工具执行结束。
Interrupted
运行被取消并已存档 checkpoint。
WaitingForUser
工具已返回合法结果,但该结果要求用户交互后再继续会话。
Fields
§
interaction: UserInteractionFailed
进入失败(可能仍会重试,见 max_consecutive_fail_count)。
Succeeded
推理未再产生工具调用,运行成功结束。
Implementations§
Trait Implementations§
Source§impl Clone for TrajectoryEventKind
impl Clone for TrajectoryEventKind
Source§fn clone(&self) -> TrajectoryEventKind
fn clone(&self) -> TrajectoryEventKind
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 TrajectoryEventKind
impl Debug for TrajectoryEventKind
Source§impl<'de> Deserialize<'de> for TrajectoryEventKind
impl<'de> Deserialize<'de> for TrajectoryEventKind
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 TrajectoryEventKind
impl RefUnwindSafe for TrajectoryEventKind
impl Send for TrajectoryEventKind
impl Sync for TrajectoryEventKind
impl Unpin for TrajectoryEventKind
impl UnsafeUnpin for TrajectoryEventKind
impl UnwindSafe for TrajectoryEventKind
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