Skip to main content

TeamSession Attributes

ParameterTypeDefaultDescription
session_idstrRequiredSession UUID
team_idOptional[str]NoneID of the team that this session is associated with
user_idOptional[str]NoneID of the user interacting with this team
workflow_idOptional[str]NoneID of the workflow that this session is associated with
team_dataOptional[Dict[str, Any]]NoneTeam Data: name, team_id, model, and mode
session_dataOptional[Dict[str, Any]]NoneSession Data: session_state, images, videos, audio
metadataOptional[Dict[str, Any]]NoneMetadata stored with this team
runsOptional[List[Union[TeamRunOutput, RunOutput]]]NoneList of all runs in the session
summaryOptional[SessionSummary]NoneSummary of the session
created_atOptional[int]NoneThe unix timestamp when this session was created
updated_atOptional[int]NoneThe unix timestamp when this session was last updated

TeamSession Methods

upsert_run(run: TeamRunOutput)

Adds a TeamRunOutput to the runs list. If a run with the same run_id already exists, it updates the existing run.

get_run(run_id: str) -> Optional[RunOutput]

Retrieves a specific run by its run_id.

get_messages_from_last_n_runs(...) -> List[Message]

Gets messages from the last N runs with various filtering options:
  • agent_id: Filter by agent ID
  • team_id: Filter by team ID
  • last_n: Number of recent runs to include
  • skip_role: Skip messages with specific role
  • skip_status: Skip runs with specific statuses
  • skip_history_messages: Whether to skip history messages

get_session_summary() -> Optional[SessionSummary]

Get the session summary for the session

get_chat_history() -> List[Message]

Get the chat history for the session