feat(api): update via SDK Studio

This commit is contained in:
stainless-app[bot] 2025-06-30 17:41:50 +00:00
parent 6d8571b73d
commit d70071b1fc
6 changed files with 84 additions and 35 deletions

View file

@ -80,6 +80,32 @@ async def main() -> None:
asyncio.run(main())
```
## Streaming responses
We provide support for streaming responses using Server Side Events (SSE).
```python
from opencode_ai import Opencode
client = Opencode()
stream = client.event.list()
for events in stream:
print(events)
```
The async client uses the exact same interface.
```python
from opencode_ai import AsyncOpencode
client = AsyncOpencode()
stream = await client.event.list()
async for events in stream:
print(events)
```
## Using types
Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like: