feat: move to overload typing for stream:true intent for sse

This commit is contained in:
David Alberto Adler
2025-09-08 12:21:06 +01:00
parent 2988b5e385
commit 80fd801021
129 changed files with 1218 additions and 3872 deletions
+8 -4
View File
@@ -16,8 +16,10 @@ with OpenRouter(
},
], stream=False, temperature=1, top_p=1)
# Handle response
print(res)
with res as event_stream:
for event in event_stream:
# handle event
print(event, flush=True)
```
</br>
@@ -42,8 +44,10 @@ async def main():
},
], stream=False, temperature=1, top_p=1)
# Handle response
print(res)
async with res as event_stream:
async for event in event_stream:
# handle event
print(event, flush=True)
asyncio.run(main())
```