mirror of
https://github.com/anomalyco/opencode-sdk-python.git
synced 2026-04-28 04:29:50 +00:00
feat(api): api update
This commit is contained in:
parent
6e129bc0a3
commit
7a9790fae8
2 changed files with 27 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
26
README.md
26
README.md
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue