Learn how to run a team and get the response.
Team.run()
function runs the team and generates a response, either as a TeamRunResponse
object or a stream of TeamRunResponseEvent
objects.
Many of our examples use team.print_response()
which is a helper utility to print the response in the terminal. It uses team.run()
under the hood.
Here’s how to run your team. The response is captured in the response
and response_stream
variables.
stream_intermediate_steps=True
.
stream_member_events=False
.RunResponse
object.
TeamRunResponseContentEvent
and RunResponseContentEvent
events are not stored. You can modify which events are skipped by setting the events_to_skip
parameter.
For example:
Team.run()
and Team.arun()
functions depending on team’s configuration:
Event Type | Description |
---|---|
TeamRunStarted | Indicates the start of a run |
TeamRunResponseContent | Contains the model’s response text as individual chunks |
TeamRunCompleted | Signals successful completion of the run |
TeamRunError | Indicates an error occurred during the run |
TeamRunCancelled | Signals that the run was cancelled |
Event Type | Description |
---|---|
TeamToolCallStarted | Indicates the start of a tool call |
TeamToolCallCompleted | Signals completion of a tool call, including tool call results |
Event Type | Description |
---|---|
TeamReasoningStarted | Indicates the start of the agent’s reasoning process |
TeamReasoningStep | Contains a single step in the reasoning process |
TeamReasoningCompleted | Signals completion of the reasoning process |
Event Type | Description |
---|---|
TeamMemoryUpdateStarted | Indicates that the agent is updating its memory |
TeamMemoryUpdateCompleted | Signals completion of a memory update |
Team.run()
or Team.print_response()
as the message
parameter.