schrodinger.maestro_utils.composer_agent.session_handler module

class schrodinger.maestro_utils.composer_agent.session_handler.ChatSessionHandler

Bases: object

This class holds the session id for current session with composer agent. It resets the session id if the gap between the last and current query is greater than the threshold.

Variables:
  • session_id – The current session id.

  • last_query_time – The time of the last query.

  • threshold – The time gap threshold.

threshold: int = 3600
session_id: Optional[str] = None
last_query_time: Optional[datetime] = None
__init__()

Initialize the session handler.

setSessionId(session_id: str)

Set the current session id.

getSessionId()

Get the current session id. It will first refresh the session id before returning it.