import asyncio
from agents import Agent, Runner
market = Agent(name="Market researcher",
instructions="Assess market size and competitors. Return 5 bullet points.")
tech = Agent(name="Tech researcher",
instructions="Assess technical feasibility and key risks. Return 5 bullet points.")
orchestrator = Agent(
name="Lead analyst",
instructions=("Split the question into market and technical sub-questions, call "
"both researchers, then write one memo that resolves any conflicts."),
tools=[
market.as_tool(tool_name="research_market", tool_description="Market and competitor research"),
tech.as_tool(tool_name="research_tech", tool_description="Technical feasibility research"),
],
)
async def main():
result = await Runner.run(orchestrator, input="Should we build AI bookkeeping for EU freelancers?")
print(result.final_output)
asyncio.run(main())