GeezerVison is showing adk.dev — InMemorySessionService | ADK for TypeScript: API Reference - v2.5.0
Class InMemorySessionService
An in-memory implementation of the session service.
Every map below is keyed by untrusted input — appName, userId,
sessionId and state keys all arrive straight off the request path or body
on a dev server — so each is created with Object.create(null). On an
ordinary {} literal a key of __proto__ resolves to the inherited
__proto__ accessor instead of creating an own property, so
map[appName][userId] = ... writes onto Object.prototype and pollutes
every object in the process. A null-prototype map has no such accessor, so
those keys become ordinary own properties.
Constructors
constructor
-
new InMemorySessionService(): InMemorySessionService
Returns InMemorySessionService
Methods
appendEvent
-
Appends an event to a session.
Returns Promise<Event>
A promise that resolves to the event that was appended.
createSession
-
Returns Promise<Session>
A promise that resolves to the newly created session instance.
deleteSession
-
Returns Promise<void>
A promise that resolves when the session is deleted.
getOrCreateSession
-
Gets a session or creates one if it doesn't exist.
Returns Promise<Session>
A promise that resolves to the session instance.
getSession
-
Returns Promise<Session | undefined>
A promise that resolves to the session instance or undefined if not
found.
listSessions
-
Lists sessions for a user.
A promise that resolves to a list of sessions for the user.