Resume session
How to resume a previous session.When using interactive chat in an Artisan command
When using a fixed session ID
If your flow is not interactive, specify a fixed ID from the beginning. Create IDs based on user IDs or other context. For example, this works well in a multi-user web service.resume to Copilot::start.
Copilot::start closure and resume another one.
Resume the last session
If no session exists,getLastSessionId() returns null, and the session starts as new.
You can switch between SessionConfig and ResumeSessionConfig.
Use SessionMetadata
getSessionMetadata() also returns null when the session does not exist, so you can use the same new-session fallback.
It also provides metadata such as created/updated timestamps.
For the latest updates, see the GitHub repository.