TeamSession Attributes
Parameter | Type | Default | Description |
---|---|---|---|
session_id | str | Required | Session UUID |
team_id | Optional[str] | None | ID of the team that this session is associated with |
user_id | Optional[str] | None | ID of the user interacting with this team |
workflow_id | Optional[str] | None | ID of the workflow that this session is associated with |
team_data | Optional[Dict[str, Any]] | None | Team Data: name, team_id, model, and mode |
session_data | Optional[Dict[str, Any]] | None | Session Data: session_state, images, videos, audio |
metadata | Optional[Dict[str, Any]] | None | Metadata stored with this team |
runs | Optional[List[Union[TeamRunOutput, RunOutput]]] | None | List of all runs in the session |
summary | Optional[SessionSummary] | None | Summary of the session |
created_at | Optional[int] | None | The unix timestamp when this session was created |
updated_at | Optional[int] | None | The 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 IDteam_id
: Filter by team IDlast_n
: Number of recent runs to includeskip_role
: Skip messages with specific roleskip_status
: Skip runs with specific statusesskip_history_messages
: Whether to skip history messages