AI agent instructions
AI agent instructions
session.storage. Files expire after a retention period, so download the ones you need.
client.FileStorage(session_id="<session-id>").
Methods
upload
file_path- Path to the local fileupload_file_name- Optional custom name for the file in storage
SessionFile - The stored file (id, filename, mime_type, size, checksum, source, created_at, expires_at)
list
source-"user_upload"for files you uploaded,"session_download"for files the browser downloaded, orNonefor bothlimit- Maximum number of files to return (default: 100)offset- Number of files to skip, for pagination (default: 0)
SessionFilesPage - files (a list of SessionFile), total, limit and offset
download
file_id- ID of the file, fromupload()orlist()local_dir- Local directory to save the file (default: current directory)force- Overwrite an existing local file (default: False). Without it, an existing file raisesFileExistsError.
str - Path of the downloaded file
delete
file_id- ID of the file to delete
File metadata
To get a single file’s metadata without downloading it, useclient.files.metadata(session_id, file_id), which returns its SessionFile.
Parameters
UnionType[str, None]
default:"None"