ADK for TypeScript: API Reference
    Preparing search index...

    Interface Event

    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.

    interface Event {
        actions: EventActions;
        author?: string;
        branch?: string;
        content?: Content;
        customMetadata?: { [key: string]: any };
        errorCode?: string;
        errorMessage?: string;
        finishReason?: FinishReason;
        groundingMetadata?: GroundingMetadata;
        id: string;
        inputTranscription?: Transcription;
        interrupted?: boolean;
        invocationId: string;
        liveSessionResumptionUpdate?: LiveServerSessionResumptionUpdate;
        longRunningToolIds?: string[];
        outputTranscription?: Transcription;
        partial?: boolean;
        timestamp: number;
        turnComplete?: boolean;
        usageMetadata?: GenerateContentResponseUsageMetadata;
    }

    Hierarchy (View Summary)

    Properties

    actions: EventActions

    The actions taken by the agent.

    author?: string

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

    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-agent shouldn't see their peer agents' conversation history.

    content?: Content

    The content of the response.

    customMetadata?: { [key: string]: any }

    The custom metadata of the LlmResponse. An optional key-value pair to label an LlmResponse. NOTE: the entire object must be JSON serializable.

    errorCode?: string

    Error code if the response is an error. Code varies by model.

    errorMessage?: string

    Error message if the response is an error.

    finishReason?: FinishReason

    The finish reason of the response.

    groundingMetadata?: GroundingMetadata

    The grounding metadata of the response.

    id: string

    The unique identifier of the event. Do not assign the ID. It will be assigned by the session.

    inputTranscription?: Transcription

    Audio transcription of user input.

    interrupted?: boolean

    Flag indicating that LLM was interrupted when generating the content. Usually it's due to user interruption during a bidi streaming.

    invocationId: string

    The invocation ID of the event. Should be non-empty before appending to a session.

    liveSessionResumptionUpdate?: LiveServerSessionResumptionUpdate

    The session resumption update of the LlmResponse

    longRunningToolIds?: 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

    outputTranscription?: Transcription

    Audio transcription of model output.

    partial?: boolean

    Indicates whether the text content is part of a unfinished text stream. Only used for streaming mode and when the content is plain text.

    timestamp: number

    The timestamp of the event.

    turnComplete?: boolean

    Indicates whether the response from the model is complete. Only used for streaming mode.

    usageMetadata?: GenerateContentResponseUsageMetadata

    The usage metadata of the LlmResponse.