Skip to main content

Attributes

The Team class accepts the following parameters:
AttributeTypeDefaultDescription
agentslist[Any](required)List of Agent instances to use as team members
taskslist[Task] | NoneNoneList of tasks to execute (optional)
modelAny | NoneNoneModel provider for internal agents (leader, router)
response_formatAnystrResponse format for the final output
ask_other_team_membersboolFalseFlag to add other agents as tools
modestr"sequential"Operational mode: ‘sequential’, ‘coordinate’, or ‘route’
memoryMemory | NoneNoneShared memory for team coordination

Configuration Example

from upsonic import Agent, Task, Team
from upsonic import Memory
from upsonic.storage.providers.sqlite import SqliteStorage

# Create storage and memory
storage = SqliteStorage("sessions", "profiles", "team_memory.db")
memory = Memory(storage=storage, session_id="team_001")

# Create specialized agents
data_analyst = Agent(
    "openai/gpt-4o",
    name="DataAnalyst",
    role="Data analysis expert"
)

report_writer = Agent(
    "openai/gpt-4o",
    name="ReportWriter",
    role="Technical writer"
)

# Create team with configuration
team = Team(
    agents=[data_analyst, report_writer],
    mode="coordinate",
    model="openai/gpt-4o",
    memory=memory,
    ask_other_team_members=True
)

# Define tasks
tasks = [
    Task("Analyze quarterly sales data"),
    Task("Write a comprehensive report based on the analysis")
]

# Execute team
result = team.do(tasks)
print(result)