TeamRunOutput

Attributes of TeamRunOutput and the events streamed during a team run.

The 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

AttributeTypeDefaultDescription
contentAnyNoneContent of the response
content_typestr"str"Specifies the data type of the content
messagesOptional[List[Message]]NoneA list of messages included in the response
metricsOptional[RunMetrics]NoneUsage metrics of the run
modelOptional[str]NoneThe model used in the run
model_providerOptional[str]NoneThe model provider used in the run
member_responsesList[Union[TeamRunOutput, RunOutput]][]Responses from individual team members
run_idOptional[str]NoneRun ID
team_idOptional[str]NoneTeam ID for the run
team_nameOptional[str]NoneName of the team
session_idOptional[str]NoneSession ID for the run
parent_run_idOptional[str]NoneParent run ID if this is a nested run
user_idOptional[str]NoneUser ID for the run
toolsOptional[List[ToolExecution]]NoneList of tool executions from the run
imagesOptional[List[Image]]NoneList of images from member runs
videosOptional[List[Video]]NoneList of videos from member runs
audioOptional[List[Audio]]NoneList of audio snippets from member runs
filesOptional[List[File]]NoneList of files from member runs
response_audioOptional[Audio]NoneThe model's raw response in audio
inputOptional[TeamRunInput]NoneInput media and messages from user
reasoning_contentOptional[str]NoneAny reasoning content the model produced
citationsOptional[Citations]NoneAny citations used in the response
followupsOptional[List[str]]NoneSuggested followup prompts generated after the run, when followups are enabled
model_provider_dataOptional[Dict[str, Any]]NoneModel provider specific metadata
metadataOptional[Dict[str, Any]]NoneAdditional metadata for the run
session_stateOptional[Dict[str, Any]]NoneSession state for the run
referencesOptional[List[MessageReferences]]NoneMessage references
additional_inputOptional[List[Message]]NoneAdditional input messages
reasoning_stepsOptional[List[ReasoningStep]]NoneReasoning steps taken during execution
reasoning_messagesOptional[List[Message]]NoneMessages related to reasoning
created_atintCurrent timestampUnix timestamp of the response creation
eventsOptional[List[Union[RunOutputEvent, TeamRunOutputEvent]]]NoneList of events that occurred during the run
statusRunStatusRunStatus.runningCurrent status of the run
requirementsOptional[List[RunRequirement]]NoneHITL requirements to continue a paused run
queue_attemptOptional[int]NoneDurable queue attempt that owns this run output
last_checkpoint_at_message_indexOptional[int]NoneIndex into messages at the most recent checkpoint write. Set when checkpoint="tool-batch" persists mid-run state
forked_from_run_idOptional[str]NoneRun ID this run was forked from
forked_from_message_indexOptional[int]NoneMessage index in the source run where the fork was created
forked_from_session_idOptional[str]NoneSession ID this run was originally created in. Set when a session is forked and preserved across nested forks
regenerated_fromOptional[str]NoneRun ID of the immediate predecessor this run was regenerated from
workflow_step_idOptional[str]NoneFK: Points to StepOutput.step_id

TeamRunOutputEvent Types

The following events are sent by the Team.run() function depending on the team's configuration:

Core Events

Event TypeDescription
TeamRunStartedIndicates the start of a team run
TeamRunContentContains the model's response text as individual chunks
TeamRunContentCompletedSignals completion of content streaming
TeamRunIntermediateContentContains intermediate content during the run
TeamRunCompletedSignals successful completion of the team run
TeamRunErrorIndicates an error occurred during the team run
TeamRunCancelledSignals that the team run was cancelled
TeamRunPausedIndicates that the team run is paused for HITL requirements
TeamRunContinuedIndicates that a paused team run has continued

Pre-Hook Events

Event TypeDescription
TeamPreHookStartedIndicates the start of a pre-run hook
TeamPreHookCompletedSignals completion of a pre-run hook execution

Post-Hook Events

Event TypeDescription
TeamPostHookStartedIndicates the start of a post-run hook
TeamPostHookCompletedSignals completion of a post-run hook execution

Tool Events

Event TypeDescription
TeamToolCallStartedIndicates the start of a tool call
TeamToolCallCompletedSignals completion of a tool call, including tool call results
TeamToolCallErrorIndicates a tool call error

Reasoning Events

Event TypeDescription
TeamReasoningStartedIndicates the start of the team's reasoning process
TeamReasoningStepContains a single step in the reasoning process
TeamReasoningContentDeltaStreams reasoning content chunks
TeamReasoningCompletedSignals completion of the reasoning process

Memory Events

Event TypeDescription
TeamMemoryUpdateStartedIndicates that the team is updating its memory
TeamMemoryUpdateCompletedSignals completion of a memory update

Session Summary Events

Event TypeDescription
TeamSessionSummaryStartedIndicates the start of session summary generation
TeamSessionSummaryCompletedSignals completion of session summary generation

Parser Model Events

Event TypeDescription
TeamParserModelResponseStartedIndicates the start of parser model response
TeamParserModelResponseCompletedSignals completion of parser model response

Output Model Events

Event TypeDescription
TeamOutputModelResponseStartedIndicates the start of output model response
TeamOutputModelResponseCompletedSignals completion of output model response

Model Request Events

Event TypeDescription
TeamModelRequestStartedIndicates the start of a model request
TeamModelRequestCompletedSignals completion of a model request

Compression Events

Event TypeDescription
TeamCompressionStartedIndicates the start of tool result compression
TeamCompressionCompletedSignals completion of tool result compression

Followups Events

Event TypeDescription
TeamFollowupsStartedIndicates the start of followup generation
TeamFollowupsCompletedSignals completion of followup generation, including the suggested prompts

Task Mode Events

Event TypeDescription
TeamTaskIterationStartedIndicates the start of a task iteration in tasks mode
TeamTaskIterationCompletedSignals completion of a task iteration in tasks mode
TeamTaskStateUpdatedContains the full structured task list after a state change
TeamTaskCreatedSent immediately when a task is created
TeamTaskUpdatedSent immediately when a task status changes

Custom Events

Event TypeDescription
CustomEventCustom event emitted by the team

Event Attributes

Base TeamRunOutputEvent

All events inherit from BaseTeamRunEvent which provides these common attributes:

AttributeTypeDefaultDescription
created_atintCurrent timestampUnix timestamp of the event creation
eventstr""The type of event
team_idstr""ID of the team generating the event
team_namestr""Name of the team generating the event
run_idOptional[str]NoneID of the current run
parent_run_idOptional[str]NoneParent run ID if this is a nested run
session_idOptional[str]NoneID of the current session
workflow_idOptional[str]NoneID of the workflow
workflow_run_idOptional[str]NoneID of the workflow's run
step_idOptional[str]NoneID of the workflow step
step_nameOptional[str]NoneName of the workflow step
step_indexOptional[int]NoneIndex of the workflow step
event_indexOptional[int]NoneMonotonic replay cursor for the stream. Values may contain gaps across retries and continued runs
nested_depthint0Nesting depth of the execution. 0 for top-level, incremented for each level of nesting
contentOptional[Any]NoneFor backwards compatibility

RunStartedEvent

AttributeTypeDefaultDescription
eventstr"TeamRunStarted"Event type
modelstr""The model being used
model_providerstr""The provider of the model

IntermediateRunContentEvent

AttributeTypeDefaultDescription
eventstr"TeamRunIntermediateContent"Event type
contentOptional[Any]NoneIntermediate content of the response
content_typestr"str"Type of the content

RunContentCompletedEvent

AttributeTypeDefaultDescription
eventstr"TeamRunContentCompleted"Event type

RunContentEvent

AttributeTypeDefaultDescription
eventstr"TeamRunContent"Event type
contentOptional[Any]NoneThe content of the response
content_typestr"str"Type of the content
reasoning_contentOptional[str]NoneReasoning content produced
citationsOptional[Citations]NoneCitations used in the response
model_provider_dataOptional[Dict[str, Any]]NoneModel provider specific metadata
response_audioOptional[Audio]NoneModel's audio response
imageOptional[Image]NoneImage attached to the response
referencesOptional[List[MessageReferences]]NoneMessage references
additional_inputOptional[List[Message]]NoneAdditional input messages
reasoning_stepsOptional[List[ReasoningStep]]NoneReasoning steps
reasoning_messagesOptional[List[Message]]NoneReasoning messages

RunCompletedEvent

AttributeTypeDefaultDescription
eventstr"TeamRunCompleted"Event type
contentOptional[Any]NoneFinal content of the response
content_typestr"str"Type of the content
reasoning_contentOptional[str]NoneReasoning content produced
citationsOptional[Citations]NoneCitations used in the response
model_provider_dataOptional[Dict[str, Any]]NoneModel provider specific metadata
imagesOptional[List[Image]]NoneImages attached to the response
videosOptional[List[Video]]NoneVideos attached to the response
audioOptional[List[Audio]]NoneAudio snippets attached to the response
filesOptional[List[File]]NoneFiles attached to the response
response_audioOptional[Audio]NoneModel's audio response
referencesOptional[List[MessageReferences]]NoneMessage references
additional_inputOptional[List[Message]]NoneAdditional input messages
reasoning_stepsOptional[List[ReasoningStep]]NoneReasoning steps
reasoning_messagesOptional[List[Message]]NoneReasoning messages
member_responsesList[Union[TeamRunOutput, RunOutput]][]Responses from individual team members
metadataOptional[Dict[str, Any]]NoneAdditional metadata
metricsOptional[RunMetrics]NoneUsage metrics
session_stateOptional[Dict[str, Any]]NoneSession state after the run

RunErrorEvent

AttributeTypeDefaultDescription
eventstr"TeamRunError"Event type
contentOptional[str]NoneError message
error_typeOptional[str]NoneError type
error_idOptional[str]NoneError identifier
additional_dataOptional[Dict[str, Any]]NoneAdditional error data

RunCancelledEvent

AttributeTypeDefaultDescription
eventstr"TeamRunCancelled"Event type
reasonOptional[str]NoneReason for cancellation

RunPausedEvent

AttributeTypeDefaultDescription
eventstr"TeamRunPaused"Event type
toolsOptional[List[ToolExecution]]NoneTool executions for pending requirements
requirementsOptional[List[RunRequirement]]NoneHITL requirements for the run

RunContinuedEvent

AttributeTypeDefaultDescription
eventstr"TeamRunContinued"Event type

PreHookStartedEvent

AttributeTypeDefaultDescription
eventstr"TeamPreHookStarted"Event type
pre_hook_nameOptional[str]NoneName of the pre-hook being executed
run_inputOptional[TeamRunInput]NoneThe run input passed to the hook

PreHookCompletedEvent

AttributeTypeDefaultDescription
eventstr"TeamPreHookCompleted"Event type
pre_hook_nameOptional[str]NoneName of the pre-hook that completed
run_inputOptional[TeamRunInput]NoneThe run input passed to the hook

PostHookStartedEvent

AttributeTypeDefaultDescription
eventstr"TeamPostHookStarted"Event type
post_hook_nameOptional[str]NoneName of the post-hook being executed

PostHookCompletedEvent

AttributeTypeDefaultDescription
eventstr"TeamPostHookCompleted"Event type
post_hook_nameOptional[str]NoneName of the post-hook that completed

ToolCallStartedEvent

AttributeTypeDefaultDescription
eventstr"TeamToolCallStarted"Event type
toolOptional[ToolExecution]NoneThe tool being called

ToolCallCompletedEvent

AttributeTypeDefaultDescription
eventstr"TeamToolCallCompleted"Event type
toolOptional[ToolExecution]NoneThe tool that was called
contentOptional[Any]NoneResult of the tool call
imagesOptional[List[Image]]NoneImages produced by the tool
videosOptional[List[Video]]NoneVideos produced by the tool
audioOptional[List[Audio]]NoneAudio produced by the tool
filesOptional[List[File]]NoneFiles produced by the tool

ToolCallErrorEvent

AttributeTypeDefaultDescription
eventstr"TeamToolCallError"Event type
toolOptional[ToolExecution]NoneThe tool that failed
errorOptional[str]NoneError message

ReasoningStartedEvent

AttributeTypeDefaultDescription
eventstr"TeamReasoningStarted"Event type

ReasoningStepEvent

AttributeTypeDefaultDescription
eventstr"TeamReasoningStep"Event type
contentOptional[Any]NoneContent of the reasoning step
content_typestr"str"Type of the content
reasoning_contentstr""Detailed reasoning content

ReasoningContentDeltaEvent

AttributeTypeDefaultDescription
eventstr"TeamReasoningContentDelta"Event type
reasoning_contentstr""Reasoning content chunk

ReasoningCompletedEvent

AttributeTypeDefaultDescription
eventstr"TeamReasoningCompleted"Event type
contentOptional[Any]NoneContent of the reasoning step
content_typestr"str"Type of the content

MemoryUpdateStartedEvent

AttributeTypeDefaultDescription
eventstr"TeamMemoryUpdateStarted"Event type

MemoryUpdateCompletedEvent

AttributeTypeDefaultDescription
eventstr"TeamMemoryUpdateCompleted"Event type
memoriesOptional[List[Any]]NoneMemories updated by the run

SessionSummaryStartedEvent

AttributeTypeDefaultDescription
eventstr"TeamSessionSummaryStarted"Event type

SessionSummaryCompletedEvent

AttributeTypeDefaultDescription
eventstr"TeamSessionSummaryCompleted"Event type
session_summaryOptional[Any]NoneThe generated session summary

ParserModelResponseStartedEvent

AttributeTypeDefaultDescription
eventstr"TeamParserModelResponseStarted"Event type

ParserModelResponseCompletedEvent

AttributeTypeDefaultDescription
eventstr"TeamParserModelResponseCompleted"Event type

OutputModelResponseStartedEvent

AttributeTypeDefaultDescription
eventstr"TeamOutputModelResponseStarted"Event type

OutputModelResponseCompletedEvent

AttributeTypeDefaultDescription
eventstr"TeamOutputModelResponseCompleted"Event type

ModelRequestStartedEvent

AttributeTypeDefaultDescription
eventstr"TeamModelRequestStarted"Event type
modelOptional[str]NoneModel identifier
model_providerOptional[str]NoneModel provider

ModelRequestCompletedEvent

AttributeTypeDefaultDescription
eventstr"TeamModelRequestCompleted"Event type
modelOptional[str]NoneModel identifier
model_providerOptional[str]NoneModel provider
input_tokensOptional[int]NoneInput token count
output_tokensOptional[int]NoneOutput token count
total_tokensOptional[int]NoneTotal token count
time_to_first_tokenOptional[float]NoneTime to first token in seconds
reasoning_tokensOptional[int]NoneReasoning token count
cache_read_tokensOptional[int]NoneCache read token count
cache_write_tokensOptional[int]NoneCache write token count

CompressionStartedEvent

AttributeTypeDefaultDescription
eventstr"TeamCompressionStarted"Event type

CompressionCompletedEvent

AttributeTypeDefaultDescription
eventstr"TeamCompressionCompleted"Event type
tool_results_compressedOptional[int]NoneNumber of compressed tool results
original_sizeOptional[int]NoneOriginal size in characters
compressed_sizeOptional[int]NoneCompressed size in characters

FollowupsStartedEvent

AttributeTypeDefaultDescription
eventstr"TeamFollowupsStarted"Event type

FollowupsCompletedEvent

AttributeTypeDefaultDescription
eventstr"TeamFollowupsCompleted"Event type
followupsOptional[List[str]]NoneSuggested followup prompts generated for the run

TaskIterationStartedEvent

AttributeTypeDefaultDescription
eventstr"TeamTaskIterationStarted"Event type
iterationint0Current task iteration number
max_iterationsint0Maximum number of task iterations

TaskIterationCompletedEvent

AttributeTypeDefaultDescription
eventstr"TeamTaskIterationCompleted"Event type
iterationint0Task iteration number that completed
max_iterationsint0Maximum number of task iterations
task_summaryOptional[str]NoneSummary of the task state after the iteration

TaskStateUpdatedEvent

AttributeTypeDefaultDescription
eventstr"TeamTaskStateUpdated"Event type
task_summaryOptional[str]NoneSummary of the current task state
goal_completeboolFalseWhether the overall goal is complete
tasksList[TaskData][]Full structured task list for frontend rendering
completion_summaryOptional[str]NoneSummary of the work done, set when the goal is marked complete

TaskCreatedEvent

AttributeTypeDefaultDescription
eventstr"TeamTaskCreated"Event type
task_idstr""ID of the created task
titlestr""Title of the task
descriptionstr""Description of the task
assigneeOptional[str]NoneMember assigned to the task
statusstr"pending"Status of the task
dependenciesList[str][]IDs of tasks that must complete before this task

TaskUpdatedEvent

AttributeTypeDefaultDescription
eventstr"TeamTaskUpdated"Event type
task_idstr""ID of the updated task
titlestr""Title of the task
statusstr""New status: pending, in_progress, completed, failed, or blocked
previous_statusOptional[str]NoneStatus before the update
resultOptional[str]NoneResult of the task, if completed
assigneeOptional[str]NoneMember assigned to the task

CustomEvent

AttributeTypeDefaultDescription
eventstr"CustomEvent"Event type