listUserSessions
List sessions IDs based on the user ID
Allows you to retrieve a list of session IDs associated with a particular user. This can be useful for managing user interactions and potentially retrieving specific sessions based on user IDs.
To create a session that belongs to a specific user just specify the user_id
property when creating a new session using the newSession method.
Arguments
The user ID for which you want to retrieve a list of session IDs. It’s important to remember that this method relies on user IDs being associated with sessions during creation.
Response
Returns a Promise that resolves to an array of strings. Each string
in the array represents the unique ID of a session belonging to the provided user. If no sessions are found for the specified user, the method will resolve to an empty array.
You can then use one of these methods with the IDs:
- getSession: To get the session info.
- getSessionRuns: Get the runs (messages) of the session.
Was this page helpful?