TeamSession Attributes
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(...) -> List[Message]
Returns the messages belonging to the session that fit the given criteria.
Parameters:
team_id(Optional[str]): The id of the team to get the messages frommember_ids(Optional[List[str]]): The ids of the members to get the messages fromlast_n_runs(Optional[int]): The number of runs to return messages from, counting from the latest. Defaults to all runslimit(Optional[int]): The number of messages to return, counting from the latest. Defaults to all messagesskip_roles(Optional[List[str]]): Skip messages with these rolesskip_statuses(Optional[List[RunStatus]]): Skip messages with these statusesskip_history_messages(bool): Skip messages that were tagged as history in previous runs. Defaults to Trueskip_member_messages(bool): Skip messages created by members of the team. Defaults to True
List[Message]: The messages for the session
get_session_summary() -> Optional[SessionSummary]
Get the session summary for the session
get_chat_history(last_n_runs: Optional[int] = None) -> List[Message]
Get the chat history (user and assistant messages) for the session. Use get_messages() for more filtering options.
Parameters:
last_n_runs(Optional[int]): Number of recent runs to include. If None, all runs will be considered
List[Message]: The chat history for the session