pub struct Event {Show 13 fields
pub response: LlmResponse,
pub id: String,
pub timestamp: DateTime<Utc>,
pub invocation_id: String,
pub branch: String,
pub isolation_scope: String,
pub author: String,
pub actions: EventActions,
pub long_running_tool_ids: Vec<String>,
pub routes: Vec<String>,
pub requested_input: Option<RequestInput>,
pub output: Option<Value>,
pub node_info: Option<NodeInfo>,
}Expand description
An interaction in a conversation between agents and users.
Fields§
§response: LlmResponseThe model response this event carries, flattened into the event’s JSON.
id: StringSet by storage.
timestamp: DateTime<Utc>Set by storage; the zero time when unset.
invocation_id: StringSet by the agent context implementation.
branch: StringThe branch of the event, like agent_1.agent_2.agent_3.
isolation_scope: StringWhen set, the event is visible only to agent contexts with this exact isolation scope.
The name of the event’s author.
actions: EventActionsThe actions taken by the agent.
long_running_tool_ids: Vec<String>IDs of the long-running function calls.
routes: Vec<String>Routing information for workflow execution.
requested_input: Option<RequestInput>When set, the emitting workflow node asks for human input and is about to pause.
output: Option<Value>Generic data output from a workflow node.
node_info: Option<NodeInfo>Workflow-node metadata; None for non-workflow events.
Implementations§
Source§impl Event
impl Event
Sourcepub fn new(platform: &Platform, invocation_id: impl Into<String>) -> Self
pub fn new(platform: &Platform, invocation_id: impl Into<String>) -> Self
Creates an event with an ID and timestamp from platform and both action delta maps
allocated.
use gadk_platform::Platform;
let p = Platform::deterministic(1);
let a = gadk_session::Event::new(&p, "inv");
let b = gadk_session::Event::new(&Platform::deterministic(1), "inv");
assert_eq!((a.id.clone(), a.timestamp), (b.id.clone(), b.timestamp));
assert_eq!(a.actions.state_delta, Some(Default::default()));Sourcepub fn is_final_response(&self) -> bool
pub fn is_final_response(&self) -> bool
Whether the event is the final response of an agent.
When multiple agents participate in one invocation, each may produce a final response.