pub struct Event {
pub id: String,
pub timestamp: DateTime<Utc>,
pub invocation_id: String,
pub branch: String,
pub author: String,
pub llm_response: LlmResponse,
pub actions: EventActions,
pub long_running_tool_ids: Vec<String>,
}Expand description
Event represents a single interaction in a conversation. This struct embeds LlmResponse to match ADK-Go’s design pattern.
Fields§
§id: String§timestamp: DateTime<Utc>§invocation_id: String§branch: String§llm_response: LlmResponseThe LLM response containing content and metadata.
Access content via event.llm_response.content.
actions: EventActions§long_running_tool_ids: Vec<String>IDs of long-running tools associated with this event.
Implementations§
Source§impl Event
impl Event
pub fn new(invocation_id: impl Into<String>) -> Self
Sourcepub fn set_content(&mut self, content: Content)
pub fn set_content(&mut self, content: Content)
Convenience method to set content directly.
Sourcepub fn is_final_response(&self) -> bool
pub fn is_final_response(&self) -> bool
Returns whether the event is the final response of an agent.
An event is considered final if:
- It has skip_summarization set, OR
- It has long_running_tool_ids (indicating async operations), OR
- It has no function calls, no function responses, is not partial, and has no trailing code execution results.
Note: When multiple agents participate in one invocation, there could be multiple events with is_final_response() as true, for each participating agent.
Sourcepub fn function_call_ids(&self) -> Vec<String>
pub fn function_call_ids(&self) -> Vec<String>
Extracts function call IDs from this event’s content. Used to identify which function calls are associated with long-running tools.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Event
impl<'de> Deserialize<'de> for Event
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 Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnwindSafe for Event
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