from upsonic import Agent, Task
# Create a specialized agent
research_agent = Agent(
name="Research Specialist",
model="anthropic/claude-sonnet-4-5",
system_prompt="You are a research specialist focused on gathering information."
)
# Use the specialized agent as a tool
task = Task(
description="Research current AI trends and provide a summary",
tools=[research_agent]
)
# Main agent delegates to specialized agent
main_agent = Agent(
name="Main Coordinator",
model="anthropic/claude-sonnet-4-5"
)
result = main_agent.print_do(task)
print("Result:", result)