mirror of
https://github.com/hanzoai/python-sdk.git
synced 2026-10-23 20:23:00 +00:00
Fix 35 ruff errors (E722, F841, B904, B905, B007, E741, S202, S310, S306, S110, TID251, UP042, F401) and run black on 526 files. Co-authored-by: Hanzo Dev <[email protected]>
24 lines
578 B
Python
24 lines
578 B
Python
import asyncio
|
|
|
|
from openai.types.responses import ResponseTextDeltaEvent
|
|
|
|
from agents import Agent, Runner
|
|
|
|
|
|
async def main():
|
|
agent = Agent(
|
|
name="Joker",
|
|
instructions="You are a helpful assistant.",
|
|
)
|
|
|
|
result = Runner.run_streamed(agent, input="Please tell me 5 jokes.")
|
|
async for event in result.stream_events():
|
|
if event.type == "raw_response_event" and isinstance(
|
|
event.data, ResponseTextDeltaEvent
|
|
):
|
|
print(event.data.delta, end="", flush=True)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
asyncio.run(main())
|