continue vs resume (Agent SDK)
People think continue and resume are two names for one thing. continue takes the latest session in the current folder, with no ID. resume takes the one session whose ID you pass, even an old one. Use continue when your app runs one chat at a time, and resume when it runs many.
continue Option
The option that picks up the last session in the folder. No ID is needed.
continue is the Agent SDK option that picks up the most recent session in the current folder. In Python it is continue_conversation. You do not need a session ID, because the SDK finds the latest one for you. It suits an app that runs one chat at a time. To pick a session that is not the latest, use resume.
resume Option
The option that loads an old session by its ID, with all of its past.
resume is the Agent SDK option that loads a past session by its ID. You get the ID from the init message or the result message, and save it. The agent then has the whole earlier chat in its context. The session must be on the same machine, or in a session store, and the folder must match. resumeSessionAt can also load it at a set message.
In one line
- continue Option
- The option that picks up the last session in the folder. No ID is needed.
- resume Option
- The option that loads an old session by its ID, with all of its past.