Represents an event in a conversation between agents and users. It is used to store the content of the conversation, as well as the actions taken by the agents like function calls, etc.

Hierarchy (view full)

Constructors

Properties

invocationId: string = ""

The invocation ID of the event.

author: string

'user' or the name of the agent, indicating who appended the event to the session.

actions: EventActions = ...

The actions taken by the agent.

longRunningToolIds?: Set<string>

Set of ids of the long running function calls. Agent client will know from this field about which function call is long running. Only valid for function call event.

branch?: string

The branch of the event. The format is like agent_1.agent_2.agent_3, where agent_1 is the parent of agent_2, and agent_2 is the parent of agent_3. Branch is used when multiple sub-agents shouldn't see their peer agents' conversation history.

id: string = ""

The unique identifier of the event.

timestamp: number = ...

The timestamp of the event (seconds since epoch).

text?: string
content?: Content
groundingMetadata?: GroundingMetadata
partial?: boolean
turnComplete?: boolean
errorCode?: string
errorMessage?: string
interrupted?: boolean
customMetadata?: Record<string, any>
usageMetadata?: GenerateContentResponseUsageMetadata
candidateIndex?: number
finishReason?: string
error?: Error

Methods