pub enum AgentEvent {
Text(String),
Reasoning(String),
ToolCallRequest {
index: usize,
call_id: Arc<str>,
name: String,
args: Value,
},
ToolCallResult {
call_id: Arc<str>,
name: String,
result: Result<String, String>,
},
TurnStart,
TurnEnd {
finish_reason: Option<String>,
},
Error(String),
ToolApprovalRequired {
call_id: Arc<str>,
tool_name: String,
reason: String,
},
Done,
}Variants§
Text(String)
Reasoning(String)
ToolCallRequest
ToolCallResult
TurnStart
TurnEnd
Error(String)
ToolApprovalRequired
Done
Trait Implementations§
Source§impl Clone for AgentEvent
impl Clone for AgentEvent
Source§fn clone(&self) -> AgentEvent
fn clone(&self) -> AgentEvent
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 AgentEvent
impl Debug for AgentEvent
Source§impl MiddlewareEvent for AgentEvent
impl MiddlewareEvent for AgentEvent
Source§fn assistant_text(content: String, _reasoning: Option<String>) -> Self
fn assistant_text(content: String, _reasoning: Option<String>) -> Self
Factory:assistant 聚合文本回复。
Source§fn tool_call_request(call_id: Arc<str>, name: String, args: JsonValue) -> Self
fn tool_call_request(call_id: Arc<str>, name: String, args: JsonValue) -> Self
Factory:单个工具调用请求。
Source§fn tool_response(
call_id: Arc<str>,
name: String,
result: Result<String, String>,
) -> Self
fn tool_response( call_id: Arc<str>, name: String, result: Result<String, String>, ) -> Self
Factory:单个工具执行结果。
Source§fn turn_start() -> Self
fn turn_start() -> Self
Factory:turn 开始。
Source§fn into_session_message(self) -> Option<(Role, MsgVariant)>
fn into_session_message(self) -> Option<(Role, MsgVariant)>
转换为 session 历史消息。 Read more
Auto Trait Implementations§
impl Freeze for AgentEvent
impl RefUnwindSafe for AgentEvent
impl Send for AgentEvent
impl Sync for AgentEvent
impl Unpin for AgentEvent
impl UnsafeUnpin for AgentEvent
impl UnwindSafe for AgentEvent
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