Watson Assistant API v2 & session expiration

1.1k Views Asked by At

We're building an app that uses the API v2 to interact with Watson Assistant. We're aware that the "state" of the conversation (among others: the position in the dialog tree) is now kept on the service side using the session_id key. The problem: the session expires (5 to 60 minutes depending on the pricing plan).

Is there a way to either resurrect an expired session or save the conversation state so that it can be restored ?

We've tried to save and restore the global & skills contexts but they don't hold the conversation state.

Thanks for your help.

2

There are 2 best solutions below

0
oscar.ny On

The current inactivity timeout period is plan-specific - lite and standard 5 minutes - plus and premium 1 hour

In the coming days, you will be able to change that value for plus and premium up to 24 hours. Lite and Standard you will only be able to decrease to a lower value if you want to close sessions faster.

You can always save context at the application level but currently there is not a way under the V2 API to save where the user is in the dialog so that you can pass it back after exceeding the allowed session inactivity timeout period.

1
Sayuri Mizuguchi On

Complementing what @oscar.ny mentioned, it's also plan-specific and you could potentially change the timeout timing on the Settings -> Timeout limit field -> Change the value and close, it saves automatically.

Something that I've done before in the past was sending an empty message when the event of 5min inactive happened. This event would call the function that would hit the API message method to send an "Are you still here, I was talking about xyz". Where xyz was the latest message sent to the user to maintain the session.

Ref: