Skip to main content
from definable.agent.team import Team, TeamMode

Constructor

ParameterTypeDefaultDescription
namestrautoHuman-readable team name.
modelstr | ModelLeader model. String shorthand or Model instance.
membersList[Agent | Team]Member agents or nested teams.
modeTeamModecoordinateExecution mode.
instructionsstr""Leader instructions.
max_iterationsint10Max delegation rounds (tasks mode).
share_member_interactionsboolFalsePass member responses to subsequent delegations.
toolsList[Function][]Additional leader tools.
output_schemaType[BaseModel]NoneStructured output from leader.
debugboolFalseDebug logging.

TeamMode

ValueBehavior
coordinateLeader picks members, synthesizes responses.
routeLeader routes to single specialist, returns directly.
collaborateAll members in parallel, leader synthesizes.
tasksLeader decomposes into task list, delegates autonomously.

Methods

MethodReturnsDescription
run(instruction, **kwargs)RunOutputSynchronous execution.
arun(instruction, **kwargs)RunOutputAsync execution.
run_stream(instruction, **kwargs)Iterator[RunOutputEvent]Sync streaming.
arun_stream(instruction, **kwargs)AsyncIterator[RunOutputEvent]Async streaming.

Events

EventWhen
TeamRunStartedEventTeam run begins.
TeamRunCompletedEventTeam run finishes.
TeamRunErrorEventTeam run fails.
MemberDelegatedEventLeader delegates to a member.
MemberCompletedEventMember finishes.
MemberErrorEventMember fails.
MemberRoutedEventRoute mode selects member.
TaskCreatedEventTasks mode creates task.
TaskStatusChangedEventTask status changes.
TaskIterationEventTasks mode completes iteration.