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.
- Python
- TypeScript
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)
import {run} from '@openai/agents';
import {ChatSession, iztroZiweiAgent} from 'openai-iztro-agents';
const agent = iztroZiweiAgent();
const session = new ChatSession({externalUserId: 'user_42'});
const result = await run(agent, 'I was born on 1990-12-21 at 13:00, female. Summarize my current relationship pattern.', {session});
console.log(result.finalOutput);