TeamRunOutput class represents the response from a team run, containing both the team’s overall response and individual member responses. It supports streaming and provides real-time events throughout the execution of a team.
TeamRunOutput Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
content | Any | None | Content of the response |
content_type | str | "str" | Specifies the data type of the content |
messages | List[Message] | None | A list of messages included in the response |
metrics | Metrics | None | Usage metrics of the run |
model | str | None | The model used in the run |
model_provider | str | None | The model provider used in the run |
member_responses | List[Union[TeamRunOutput, RunOutput]] | [] | Responses from individual team members |
run_id | str | None | Run Id |
team_id | str | None | Team Id for the run |
team_name | str | None | Name of the team |
session_id | str | None | Session Id for the run |
parent_run_id | str | None | Parent run ID if this is a nested run |
tools | List[ToolExecution] | None | List of tools provided to the model |
images | List[Image] | None | List of images from member runs |
videos | List[Video] | None | List of videos from member runs |
audio | List[Audio] | None | List of audio snippets from member runs |
files | List[File] | None | List of files from member runs |
response_audio | Audio | None | The model’s raw response in audio |
input | TeamRunInput | None | Input media and messages from user |
reasoning_content | str | None | Any reasoning content the model produced |
citations | Citations | None | Any citations used in the response |
model_provider_data | Any | None | Model provider specific metadata |
metadata | Dict[str, Any] | None | Additional metadata for the run |
references | List[MessageReferences] | None | Message references |
additional_input | List[Message] | None | Additional input messages |
reasoning_steps | List[ReasoningStep] | None | Reasoning steps taken during execution |
reasoning_messages | List[Message] | None | Messages related to reasoning |
created_at | int | Current timestamp | Unix timestamp of the response creation |
events | List[Union[RunOutputEvent, TeamRunOutputEvent]] | None | List of events that occurred during the run |
status | RunStatus | RunStatus.running | Current status of the run |
workflow_step_id | str | None | FK: Points to StepOutput.step_id |
TeamRunOutputEvent Types
The following events are sent by theTeam.run() function depending on the team’s configuration:
Core Events
| Event Type | Description |
|---|---|
TeamRunStarted | Indicates the start of a team run |
TeamRunContent | Contains the model’s response text as individual chunks |
TeamRunContentCompleted | Signals completion of content streaming |
TeamRunIntermediateContent | Contains intermediate content during the run |
TeamRunCompleted | Signals successful completion of the team run |
TeamRunError | Indicates an error occurred during the team run |
TeamRunCancelled | Signals that the team run was cancelled |
Pre-Hook Events
| Event Type | Description |
|---|---|
TeamPreHookStarted | Indicates the start of a pre-run hook |
TeamPreHookCompleted | Signals completion of a pre-run hook execution |
Post-Hook Events
| Event Type | Description |
|---|---|
TeamPostHookStarted | Indicates the start of a post-run hook |
TeamPostHookCompleted | Signals completion of a post-run hook execution |
Tool Events
| Event Type | Description |
|---|---|
TeamToolCallStarted | Indicates the start of a tool call |
TeamToolCallCompleted | Signals completion of a tool call, including tool call results |
Reasoning Events
| Event Type | Description |
|---|---|
TeamReasoningStarted | Indicates the start of the team’s reasoning process |
TeamReasoningStep | Contains a single step in the reasoning process |
TeamReasoningCompleted | Signals completion of the reasoning process |
Memory Events
| Event Type | Description |
|---|---|
TeamMemoryUpdateStarted | Indicates that the team is updating its memory |
TeamMemoryUpdateCompleted | Signals completion of a memory update |
Session Summary Events
| Event Type | Description |
|---|---|
TeamSessionSummaryStarted | Indicates the start of session summary generation |
TeamSessionSummaryCompleted | Signals completion of session summary generation |
Event Attributes
Base TeamRunOutputEvent
All events inherit fromBaseTeamRunEvent which provides these common attributes:
| Attribute | Type | Default | Description |
|---|---|---|---|
created_at | int | Current timestamp | Unix timestamp of the event creation |
event | str | "" | The type of event |
team_id | str | "" | ID of the team generating the event |
team_name | str | "" | Name of the team generating the event |
run_id | Optional[str] | None | ID of the current run |
session_id | Optional[str] | None | ID of the current session |
workflow_id | Optional[str] | None | ID of the workflow |
workflow_run_id | Optional[str] | None | ID of the workflow’s run |
step_id | Optional[str] | None | ID of the workflow step |
step_name | Optional[str] | None | Name of the workflow step |
step_index | Optional[int] | None | Index of the workflow step |
content | Optional[Any] | None | For backwards compatibility |
RunStartedEvent
| Attribute | Type | Default | Description |
|---|---|---|---|
event | str | "TeamRunStarted" | Event type |
model | str | "" | The model being used |
model_provider | str | "" | The provider of the model |
IntermediateRunContentEvent
| Attribute | Type | Default | Description |
|---|---|---|---|
event | str | "TeamRunIntermediateContent" | Event type |
content | Optional[Any] | None | Intermediate content of the response |
content_type | str | "str" | Type of the content |
RunContentCompletedEvent
| Attribute | Type | Default | Description |
|---|---|---|---|
event | str | "TeamRunContentCompleted" | Event type |
RunContentEvent
| Attribute | Type | Default | Description |
|---|---|---|---|
event | str | "TeamRunContent" | Event type |
content | Optional[Any] | None | The content of the response |
content_type | str | "str" | Type of the content |
reasoning_content | Optional[str] | None | Reasoning content produced |
citations | Optional[Citations] | None | Citations used in the response |
model_provider_data | Optional[Any] | None | Model provider specific metadata |
response_audio | Optional[Audio] | None | Model’s audio response |
image | Optional[Image] | None | Image attached to the response |
references | Optional[List[MessageReferences]] | None | Message references |
additional_input | Optional[List[Message]] | None | Additional input messages |
reasoning_steps | Optional[List[ReasoningStep]] | None | Reasoning steps |
reasoning_messages | Optional[List[Message]] | None | Reasoning messages |
RunCompletedEvent
| Attribute | Type | Default | Description |
|---|---|---|---|
event | str | "TeamRunCompleted" | Event type |
content | Optional[Any] | None | Final content of the response |
content_type | str | "str" | Type of the content |
reasoning_content | Optional[str] | None | Reasoning content produced |
citations | Optional[Citations] | None | Citations used in the response |
model_provider_data | Optional[Any] | None | Model provider specific metadata |
images | Optional[List[Image]] | None | Images attached to the response |
videos | Optional[List[Video]] | None | Videos attached to the response |
audio | Optional[List[Audio]] | None | Audio snippets attached to the response |
response_audio | Optional[Audio] | None | Model’s audio response |
references | Optional[List[MessageReferences]] | None | Message references |
additional_input | Optional[List[Message]] | None | Additional input messages |
reasoning_steps | Optional[List[ReasoningStep]] | None | Reasoning steps |
reasoning_messages | Optional[List[Message]] | None | Reasoning messages |
member_responses | List[Union[TeamRunOutput, RunOutput]] | [] | Responses from individual team members |
metadata | Optional[Dict[str, Any]] | None | Additional metadata |
metrics | Optional[Metrics] | None | Usage metrics |
RunErrorEvent
| Attribute | Type | Default | Description |
|---|---|---|---|
event | str | "TeamRunError" | Event type |
content | Optional[str] | None | Error message |
RunCancelledEvent
| Attribute | Type | Default | Description |
|---|---|---|---|
event | str | "TeamRunCancelled" | Event type |
reason | Optional[str] | None | Reason for cancellation |
PreHookStartedEvent
| Attribute | Type | Default | Description |
|---|---|---|---|
event | str | "TeamPreHookStarted" | Event type |
pre_hook_name | Optional[str] | None | Name of the pre-hook being executed |
run_input | Optional[TeamRunInput] | None | The run input passed to the hook |
PreHookCompletedEvent
| Attribute | Type | Default | Description |
|---|---|---|---|
event | str | "TeamPreHookCompleted" | Event type |
pre_hook_name | Optional[str] | None | Name of the pre-hook that completed |
run_input | Optional[TeamRunInput] | None | The run input passed to the hook |
PostHookStartedEvent
| Attribute | Type | Default | Description |
|---|---|---|---|
event | str | "TeamPostHookStarted" | Event type |
post_hook_name | Optional[str] | None | Name of the post-hook being executed |
PostHookCompletedEvent
| Attribute | Type | Default | Description |
|---|---|---|---|
event | str | "TeamPostHookCompleted" | Event type |
post_hook_name | Optional[str] | None | Name of the post-hook that completed |
ToolCallStartedEvent
| Attribute | Type | Default | Description |
|---|---|---|---|
event | str | "TeamToolCallStarted" | Event type |
tool | Optional[ToolExecution] | None | The tool being called |
ToolCallCompletedEvent
| Attribute | Type | Default | Description |
|---|---|---|---|
event | str | "TeamToolCallCompleted" | Event type |
tool | Optional[ToolExecution] | None | The tool that was called |
content | Optional[Any] | None | Result of the tool call |
images | Optional[List[Image]] | None | Images produced by the tool |
videos | Optional[List[Video]] | None | Videos produced by the tool |
audio | Optional[List[Audio]] | None | Audio produced by the tool |
ReasoningStartedEvent
| Attribute | Type | Default | Description |
|---|---|---|---|
event | str | "TeamReasoningStarted" | Event type |
ReasoningStepEvent
| Attribute | Type | Default | Description |
|---|---|---|---|
event | str | "TeamReasoningStep" | Event type |
content | Optional[Any] | None | Content of the reasoning step |
content_type | str | "str" | Type of the content |
reasoning_content | str | "" | Detailed reasoning content |
ReasoningCompletedEvent
| Attribute | Type | Default | Description |
|---|---|---|---|
event | str | "TeamReasoningCompleted" | Event type |
content | Optional[Any] | None | Content of the reasoning step |
content_type | str | "str" | Type of the content |
MemoryUpdateStartedEvent
| Attribute | Type | Default | Description |
|---|---|---|---|
event | str | "TeamMemoryUpdateStarted" | Event type |
MemoryUpdateCompletedEvent
| Attribute | Type | Default | Description |
|---|---|---|---|
event | str | "TeamMemoryUpdateCompleted" | Event type |
SessionSummaryStartedEvent
| Attribute | Type | Default | Description |
|---|---|---|---|
event | str | "TeamSessionSummaryStarted" | Event type |
SessionSummaryCompletedEvent
| Attribute | Type | Default | Description |
|---|---|---|---|
event | str | "TeamSessionSummaryCompleted" | Event type |
session_summary | Optional[Any] | None | The generated session summary |
ParserModelResponseStartedEvent
| Attribute | Type | Default | Description |
|---|---|---|---|
event | str | "TeamParserModelResponseStarted" | Event type |
ParserModelResponseCompletedEvent
| Attribute | Type | Default | Description |
|---|---|---|---|
event | str | "TeamParserModelResponseCompleted" | Event type |
OutputModelResponseStartedEvent
| Attribute | Type | Default | Description |
|---|---|---|---|
event | str | "TeamOutputModelResponseStarted" | Event type |
OutputModelResponseCompletedEvent
| Attribute | Type | Default | Description |
|---|---|---|---|
event | str | "TeamOutputModelResponseCompleted" | Event type |
CustomEvent
| Attribute | Type | Default | Description |
|---|---|---|---|
event | str | "CustomEvent" | Event type |