Genkit JS API reference
    Preparing search index...

    Interface AgentInit<S>

    Initialization options for an agent turn.

    For server-managed agents (with a store) provide a snapshotId (resume an exact snapshot, required for branching/snapshotting clients) and/or a sessionId (resume the session's latest snapshot - the simple case used by useChat-style clients). When both are provided, snapshotId selects the snapshot to resume and sessionId acts as an ownership guard: the snapshot must belong to that session. For client-managed agents (no store) provide the full state.

    Runtime variant of AgentInitSchema, generic over the custom state type S.

    interface AgentInit<S = unknown> {
        sessionId?: string;
        snapshotId?: string;
        state?: SessionState<S>;
    }

    Type Parameters

    • S = unknown
    Index

    Properties

    sessionId?: string
    snapshotId?: string
    state?: SessionState<S>