import asyncio
from agents import Agent, Runner
async def main():
    agent = Agent(
        name="Assistant",
        instructions="You only respond in haikus.",
        model="gpt-5-nano"  # 低価格モデル
    )
    result = await Runner.run(agent, "Tell me about recursion in programming.")
    print(result.final_output)
    # Function calls itself,
    # Looping in smaller pieces,
    # Endless by design.

if __name__ == "__main__":
    asyncio.run(main())




(.venv)PS sample>python hello_world.py
A function call back
it tries to reach the base case
base case stops the loop
＜省略＞
Prefer simple loops
for large tasks,loops are safer
resources stay in check
(.venv)PS sample>
