1
Create the team
collaborate_team.py
2
Install and run
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
All members work in parallel, leader synthesizes.
Create the team
import asyncio
from definable.agent import Agent
from definable.agent.team import Team, TeamMode
optimist = Agent(
model="gpt-4o",
instructions="You are an optimistic analyst. Focus on opportunities and positive trends.",
)
pessimist = Agent(
model="gpt-4o",
instructions="You are a cautious analyst. Focus on risks, challenges, and potential downsides.",
)
realist = Agent(
model="gpt-4o",
instructions="You are a balanced analyst. Weigh both opportunities and risks pragmatically.",
)
team = Team(
name="analysis-team",
model="gpt-4o",
members=[optimist, pessimist, realist],
mode=TeamMode.collaborate,
instructions="Synthesize all perspectives into a balanced analysis.",
)
async def main():
result = await team.arun("Analyze the impact of AI on software engineering jobs.")
print(result.content)
asyncio.run(main())
Install and run
pip install definable
uv pip install definable
poetry add definable
python collaborate_team.py