from upsonic import DeepAgent, Agent, Task
# Create specialized agents with names
researcher = Agent(
"openai/gpt-4o",
name="researcher",
system_prompt="You are a research expert focused on gathering information"
)
code_reviewer = Agent(
"openai/gpt-4o",
name="code-reviewer",
system_prompt="You are a code review expert focused on quality and best practices"
)
# Create Deep Agent with subagents
agent = DeepAgent(
"openai/gpt-4o",
subagents=[researcher, code_reviewer]
)
task = Task("Research AI trends and create a technical report with code examples")
result = agent.do(task)
# Agent can delegate research to researcher and code review to code-reviewer