UNPKG

adk-typescript

Version:

TypeScript port of Google's Agent Development Kit (ADK)

68 lines (67 loc) 2.06 kB
import { Event, SessionInterface as Session, SessionsList } from './types'; import { BaseSessionService, ListEventsResponse } from './BaseSessionService'; export declare class InMemorySessionService extends BaseSessionService { private sessions; private userState; private appState; /** * Implementation of updateSessionState abstract method * Updates a session's state. * * @param appName The application name * @param userId The user ID * @param sessionId The session ID * @param stateDelta The changes to apply to the session state * @returns The updated session */ updateSessionState(appName: string, userId: string, sessionId: string, stateDelta: Record<string, any>): Promise<Session>; createSession(options: { appName: string; userId: string; sessionId?: string; state?: Record<string, any>; }): Session; getSession(options: { appName: string; userId: string; sessionId: string; }): Session | null; listSessions(options: { appName: string; userId: string; }): SessionsList; deleteSession(options: { appName: string; userId: string; sessionId: string; }): void; listEvents(options: { appName: string; userId: string; sessionId: string; }): ListEventsResponse; appendEvent(options: { session: Session; event: Event; }): void; /** * Merges app and user state into the session */ private mergeState; /** * Creates a deep copy of an object, preserving special types like Uint8Array */ private deepCopy; /** * Creates a copy of an event while preserving special types like Uint8Array and Set */ private copyEventPreservingSpecialTypes; /** * Creates a copy of a content object while preserving binary data */ private copyContent; /** * Creates a copy of a part object while preserving binary data */ private copyPart; }