The TeamRunResponse 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.

TeamRunResponse Attributes

AttributeTypeDefaultDescription
contentAnyNoneContent of the response
content_typestr"str"Specifies the data type of the content
thinkingstrNoneAny thinking content the model produced (used by Anthropic models)
messagesList[Message]NoneA list of messages included in the response
metricsDict[str, Any]NoneUsage metrics of the run
modelstrNoneThe model used in the run
model_providerstrNoneThe model provider used in the run
member_responsesList[Union[TeamRunResponse, RunResponse]][]Responses from individual team members
run_idstrNoneRun Id
team_idstrNoneTeam Id for the run
session_idstrNoneSession Id for the run
toolsList[Dict[str, Any]]NoneList of tools provided to the model
imagesList[Image]NoneList of images from member runs
videosList[Video]NoneList of videos from member runs
audioList[Audio]NoneList of audio snippets from member runs
response_audioModelResponseAudioNoneThe model’s raw response in audio
reasoning_contentstrNoneAny reasoning content the model produced
citationsCitationsNoneAny citations used in the response
created_atintCurrent timestampUnix timestamp of the response creation
extra_dataRunResponseExtraDataNoneExtra data containing optional fields like references, add_messages, history, reasoning_steps, and reasoning_messages

TeamRunResponseEvent 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
TeamRunResponseContentContains the model’s response text as individual chunks
TeamRunCompletedSignals successful completion of the team run
TeamRunErrorIndicates an error occurred during the team run
TeamRunCancelledSignals that the team run was cancelled

Tool Events

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

Reasoning Events

Event TypeDescription
TeamReasoningStartedIndicates the start of the team’s reasoning process
TeamReasoningStepContains a single step in the reasoning process
TeamReasoningCompletedSignals completion of the reasoning process

Memory Events

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

Event Attributes

Base TeamRunResponseEvent

All events inherit from BaseTeamRunResponseEvent which provides these common attributes:

AttributeTypeDefaultDescription
created_atintCurrent timestampUnix timestamp of the event creation
eventstrEvent type valueThe type of event
team_idstr""ID of the team generating the event
run_idOptional[str]NoneID of the current run
session_idOptional[str]NoneID of the current session
contentOptional[Any]NoneFor backwards compatibility

RunResponseStartedEvent

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

RunResponseContentEvent

AttributeTypeDefaultDescription
eventstr"TeamRunResponseContent"Event type
contentOptional[Any]NoneThe content of the response
content_typestr"str"Type of the content
thinkingOptional[str]NoneInternal thoughts of the model
citationsOptional[Citations]NoneCitations used in the response
response_audioOptional[AudioResponse]NoneModel’s audio response
imageOptional[ImageArtifact]NoneImage attached to the response
extra_dataOptional[RunResponseExtraData]NoneAdditional response data

RunResponseCompletedEvent

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
thinkingOptional[str]NoneInternal thoughts of the model
citationsOptional[Citations]NoneCitations used in the response
imagesOptional[List[ImageArtifact]]NoneImages attached to the response
videosOptional[List[VideoArtifact]]NoneVideos attached to the response
audioOptional[List[AudioArtifact]]NoneAudio snippets attached to the response
response_audioOptional[AudioResponse]NoneModel’s audio response
extra_dataOptional[RunResponseExtraData]NoneAdditional response data
member_responsesList[Union[TeamRunResponse, RunResponse]][]Responses from individual team members

RunResponseErrorEvent

AttributeTypeDefaultDescription
eventstr"TeamRunError"Event type
contentOptional[Any]NoneError message

RunResponseCancelledEvent

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

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[ImageArtifact]]NoneImages produced by the tool
videosOptional[List[VideoArtifact]]NoneVideos produced by the tool
audioOptional[List[AudioArtifact]]NoneAudio produced by the tool

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

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