from upsonic import DeepAgent, Agent, Task
# Create specialized subagents
researcher = Agent(
"openai/gpt-4o",
name="researcher",
system_prompt="You are a research expert"
)
writer = Agent(
"openai/gpt-4o",
name="writer",
system_prompt="You are a technical writer"
)
# Create deep agent with subagents
agent = DeepAgent(
model="openai/gpt-4o",
subagents=[researcher, writer],
instructions="Focus on clarity and accuracy",
tool_call_limit=150
)
# Create task
task = Task(
description="Research AI frameworks and write a comprehensive comparison"
)
# Execute
result = agent.do(task)
print(result)