feat(api): api update

This commit is contained in:
stainless-app[bot] 2025-07-15 15:01:00 +00:00
parent 6e129bc0a3
commit 7a9790fae8
2 changed files with 27 additions and 1 deletions

View file

@ -1,4 +1,4 @@
configured_endpoints: 22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/opencode%2Fopencode-7270b9e4859010d6680bcc92afcd6f7c679d80a2645f65d7097d19ce2e8cdc5a.yml
openapi_spec_hash: 5fcbfaedebfea62c17c74437a9728b04
config_hash: 38a50dff50297c2f735b5e1c83fa0188
config_hash: 38041c37df28a1c4383718e6d148dd0a

View file

@ -81,6 +81,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: