getSession
Retreive a chat session by ID
Allows you to retrieve a chat session by its unique identifier within Scoopika. This can be useful for accessing specific session info like its ID and user ID.
This method does not return the actual session history (runs or messages), But it returns a StoreSession object, to get the session’s runs, refer to getSessionRuns.
Arguments
The session ID to retreive.
This optional argument controls the behavior when the specified session ID is not found. When set to true
the method will create a new session with the provided ID if it doesn’t already exist. However, it’s generally recommended to set allow_new
to false
to ensure retrieval of existing sessions only. This helps prevent unintended session creation in cases where you specifically want to access an existing one.
Return Value
Returns a Promise
that resolves to a StoreSession
object containing information about the retrieved session, including its ID, user ID (if available), user name (if available), and saved prompts (if any).
Was this page helpful?