Skip to content
Docs menu

Sessions and files

The workspace everything lives in, and why a file needs its session.

A session is a private workspace plus its files. Everything you generate or upload belongs to one. You choose the session_id (letters, digits, dot, dash, underscore, colon; up to 160 characters, starting with a letter or digit). Using the same id again continues that session, even after weeks. Another customer using the same id gets a completely separate session.

Note

Uploaded videos and generated files expire after 30 days by default. The conversation history stays.

With an SDK

You can ignore sessions. Catalyst creates a private one when you build it and uses it for every call. To share or continue work, pass a session id or set the default.

catalyst.wave.generate("rain", session_id="my-project")     # for one call
catalyst.session_id = "my-project"                            # as the default
catalyst.update_session_id("my-project")                      # the same, checked, returns the id (also update_sessionId)
catalyst.new_session()                                        # start a fresh default

One session for each of your users or clients? Switch with update_session_id; the tools you registered belong to the session they were registered in. See Client tools.

Files need their session

The API finds a file by its session and its id. Every file an SDK returns remembers its session, so downloading it is one call. If you only have a bare file id (from a database, from yesterday's run), the SDK cannot know the session and will not guess: it stops before sending anything and asks for it.

catalyst.download("fil_0123abcd")                          # InvalidRequestError: session_id is required
catalyst.download("fil_0123abcd", session_id="my-project")  # works

Store the session_id next to any file id you keep. The tutorial's manifest does exactly this.

Read a session

env = catalyst.sessions.fetch("my-project")            # timeline, files, videos in env.data
timeline = catalyst.sessions.timeline("my-project")    # sounds with stable trk_ and chk_ ids

include accepts messages, files, videos, timeline and usage. limit is 1 to 1000.