Skip to main content

Non-streaming runs

Not every workflow needs incremental text. Background jobs, webhooks, and batch reports usually want one completed result and simpler control flow. Non-streaming runs solve that use case while keeping the same Agent and ChatSession persistence model.

from agents import Runner
from iztro_agents import ChatSession, iztro_ziwei_agent

agent = iztro_ziwei_agent()
session = ChatSession(external_user_id="user_42")
result = await Runner.run(agent, "I was born on 1990-12-21 at 13:00, female. Summarize my current relationship pattern.", session=session)
print(result.final_output)