Skip to content

Commit 84628c0

Browse files
feat(api): update via SDK Studio
1 parent f3019c9 commit 84628c0

20 files changed

+925
-60
lines changed

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 16
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/opencode%2Fopencode-384a94f70b48c84af9eddcac72bbe12952c3ae3bd7fededfa1c63b203d12d828.yml
3-
openapi_spec_hash: e47ad28d646736d5d79d2dd1086d517d
4-
config_hash: e2d21e779cfc4e26a99b9e4e75de3f50
1+
configured_endpoints: 20
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/opencode%2Fopencode-e2f67adede4455c3fe4507ac6f0b2ed1a91ee951ab30e01179555c18765750d4.yml
3+
openapi_spec_hash: 6005bcfff58c025d61739be42030a339
4+
config_hash: 6c8822d278ba83456e5eed6d774ca230

api.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,32 @@ Methods:
2929
- <code title="get /app">client.app.<a href="./src/opencode_ai/resources/app.py">get</a>() -> <a href="./src/opencode_ai/types/app.py">App</a></code>
3030
- <code title="post /app/init">client.app.<a href="./src/opencode_ai/resources/app.py">init</a>() -> <a href="./src/opencode_ai/types/app_init_response.py">AppInitResponse</a></code>
3131

32+
# Find
33+
34+
Types:
35+
36+
```python
37+
from opencode_ai.types import FindFilesResponse, FindSymbolsResponse, FindTextResponse
38+
```
39+
40+
Methods:
41+
42+
- <code title="get /find/file">client.find.<a href="./src/opencode_ai/resources/find.py">files</a>(\*\*<a href="src/opencode_ai/types/find_files_params.py">params</a>) -> <a href="./src/opencode_ai/types/find_files_response.py">FindFilesResponse</a></code>
43+
- <code title="get /find/symbol">client.find.<a href="./src/opencode_ai/resources/find.py">symbols</a>(\*\*<a href="src/opencode_ai/types/find_symbols_params.py">params</a>) -> <a href="./src/opencode_ai/types/find_symbols_response.py">FindSymbolsResponse</a></code>
44+
- <code title="get /find">client.find.<a href="./src/opencode_ai/resources/find.py">text</a>(\*\*<a href="src/opencode_ai/types/find_text_params.py">params</a>) -> <a href="./src/opencode_ai/types/find_text_response.py">FindTextResponse</a></code>
45+
3246
# File
3347

3448
Types:
3549

3650
```python
37-
from opencode_ai.types import FileSearchResponse
51+
from opencode_ai.types import FileReadResponse, FileStatusResponse
3852
```
3953

4054
Methods:
4155

42-
- <code title="get /file">client.file.<a href="./src/opencode_ai/resources/file.py">search</a>(\*\*<a href="src/opencode_ai/types/file_search_params.py">params</a>) -> <a href="./src/opencode_ai/types/file_search_response.py">FileSearchResponse</a></code>
56+
- <code title="get /file">client.file.<a href="./src/opencode_ai/resources/file.py">read</a>(\*\*<a href="src/opencode_ai/types/file_read_params.py">params</a>) -> <a href="./src/opencode_ai/types/file_read_response.py">FileReadResponse</a></code>
57+
- <code title="get /file/status">client.file.<a href="./src/opencode_ai/resources/file.py">status</a>() -> <a href="./src/opencode_ai/types/file_status_response.py">FileStatusResponse</a></code>
4358

4459
# Config
4560

src/opencode_ai/_client.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
)
2222
from ._utils import is_given, get_async_library
2323
from ._version import __version__
24-
from .resources import app, file, event, config, session
24+
from .resources import app, file, find, event, config, session
2525
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
2626
from ._exceptions import APIStatusError
2727
from ._base_client import (
@@ -45,6 +45,7 @@
4545
class Opencode(SyncAPIClient):
4646
event: event.EventResource
4747
app: app.AppResource
48+
find: find.FindResource
4849
file: file.FileResource
4950
config: config.ConfigResource
5051
session: session.SessionResource
@@ -96,6 +97,7 @@ def __init__(
9697

9798
self.event = event.EventResource(self)
9899
self.app = app.AppResource(self)
100+
self.find = find.FindResource(self)
99101
self.file = file.FileResource(self)
100102
self.config = config.ConfigResource(self)
101103
self.session = session.SessionResource(self)
@@ -202,6 +204,7 @@ def _make_status_error(
202204
class AsyncOpencode(AsyncAPIClient):
203205
event: event.AsyncEventResource
204206
app: app.AsyncAppResource
207+
find: find.AsyncFindResource
205208
file: file.AsyncFileResource
206209
config: config.AsyncConfigResource
207210
session: session.AsyncSessionResource
@@ -253,6 +256,7 @@ def __init__(
253256

254257
self.event = event.AsyncEventResource(self)
255258
self.app = app.AsyncAppResource(self)
259+
self.find = find.AsyncFindResource(self)
256260
self.file = file.AsyncFileResource(self)
257261
self.config = config.AsyncConfigResource(self)
258262
self.session = session.AsyncSessionResource(self)
@@ -360,6 +364,7 @@ class OpencodeWithRawResponse:
360364
def __init__(self, client: Opencode) -> None:
361365
self.event = event.EventResourceWithRawResponse(client.event)
362366
self.app = app.AppResourceWithRawResponse(client.app)
367+
self.find = find.FindResourceWithRawResponse(client.find)
363368
self.file = file.FileResourceWithRawResponse(client.file)
364369
self.config = config.ConfigResourceWithRawResponse(client.config)
365370
self.session = session.SessionResourceWithRawResponse(client.session)
@@ -369,6 +374,7 @@ class AsyncOpencodeWithRawResponse:
369374
def __init__(self, client: AsyncOpencode) -> None:
370375
self.event = event.AsyncEventResourceWithRawResponse(client.event)
371376
self.app = app.AsyncAppResourceWithRawResponse(client.app)
377+
self.find = find.AsyncFindResourceWithRawResponse(client.find)
372378
self.file = file.AsyncFileResourceWithRawResponse(client.file)
373379
self.config = config.AsyncConfigResourceWithRawResponse(client.config)
374380
self.session = session.AsyncSessionResourceWithRawResponse(client.session)
@@ -378,6 +384,7 @@ class OpencodeWithStreamedResponse:
378384
def __init__(self, client: Opencode) -> None:
379385
self.event = event.EventResourceWithStreamingResponse(client.event)
380386
self.app = app.AppResourceWithStreamingResponse(client.app)
387+
self.find = find.FindResourceWithStreamingResponse(client.find)
381388
self.file = file.FileResourceWithStreamingResponse(client.file)
382389
self.config = config.ConfigResourceWithStreamingResponse(client.config)
383390
self.session = session.SessionResourceWithStreamingResponse(client.session)
@@ -387,6 +394,7 @@ class AsyncOpencodeWithStreamedResponse:
387394
def __init__(self, client: AsyncOpencode) -> None:
388395
self.event = event.AsyncEventResourceWithStreamingResponse(client.event)
389396
self.app = app.AsyncAppResourceWithStreamingResponse(client.app)
397+
self.find = find.AsyncFindResourceWithStreamingResponse(client.find)
390398
self.file = file.AsyncFileResourceWithStreamingResponse(client.file)
391399
self.config = config.AsyncConfigResourceWithStreamingResponse(client.config)
392400
self.session = session.AsyncSessionResourceWithStreamingResponse(client.session)

src/opencode_ai/resources/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@
1616
FileResourceWithStreamingResponse,
1717
AsyncFileResourceWithStreamingResponse,
1818
)
19+
from .find import (
20+
FindResource,
21+
AsyncFindResource,
22+
FindResourceWithRawResponse,
23+
AsyncFindResourceWithRawResponse,
24+
FindResourceWithStreamingResponse,
25+
AsyncFindResourceWithStreamingResponse,
26+
)
1927
from .event import (
2028
EventResource,
2129
AsyncEventResource,
@@ -54,6 +62,12 @@
5462
"AsyncAppResourceWithRawResponse",
5563
"AppResourceWithStreamingResponse",
5664
"AsyncAppResourceWithStreamingResponse",
65+
"FindResource",
66+
"AsyncFindResource",
67+
"FindResourceWithRawResponse",
68+
"AsyncFindResourceWithRawResponse",
69+
"FindResourceWithStreamingResponse",
70+
"AsyncFindResourceWithStreamingResponse",
5771
"FileResource",
5872
"AsyncFileResource",
5973
"FileResourceWithRawResponse",

src/opencode_ai/resources/file.py

Lines changed: 73 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import httpx
66

7-
from ..types import file_search_params
7+
from ..types import file_read_params
88
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
99
from .._utils import maybe_transform, async_maybe_transform
1010
from .._compat import cached_property
@@ -16,7 +16,8 @@
1616
async_to_streamed_response_wrapper,
1717
)
1818
from .._base_client import make_request_options
19-
from ..types.file_search_response import FileSearchResponse
19+
from ..types.file_read_response import FileReadResponse
20+
from ..types.file_status_response import FileStatusResponse
2021

2122
__all__ = ["FileResource", "AsyncFileResource"]
2223

@@ -41,19 +42,19 @@ def with_streaming_response(self) -> FileResourceWithStreamingResponse:
4142
"""
4243
return FileResourceWithStreamingResponse(self)
4344

44-
def search(
45+
def read(
4546
self,
4647
*,
47-
query: str,
48+
path: str,
4849
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
4950
# The extra values given here take precedence over values defined on the client or passed to this method.
5051
extra_headers: Headers | None = None,
5152
extra_query: Query | None = None,
5253
extra_body: Body | None = None,
5354
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
54-
) -> FileSearchResponse:
55+
) -> FileReadResponse:
5556
"""
56-
Search for files
57+
Read a file
5758
5859
Args:
5960
extra_headers: Send extra headers
@@ -71,9 +72,28 @@ def search(
7172
extra_query=extra_query,
7273
extra_body=extra_body,
7374
timeout=timeout,
74-
query=maybe_transform({"query": query}, file_search_params.FileSearchParams),
75+
query=maybe_transform({"path": path}, file_read_params.FileReadParams),
7576
),
76-
cast_to=FileSearchResponse,
77+
cast_to=FileReadResponse,
78+
)
79+
80+
def status(
81+
self,
82+
*,
83+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
84+
# The extra values given here take precedence over values defined on the client or passed to this method.
85+
extra_headers: Headers | None = None,
86+
extra_query: Query | None = None,
87+
extra_body: Body | None = None,
88+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
89+
) -> FileStatusResponse:
90+
"""Get file status"""
91+
return self._get(
92+
"/file/status",
93+
options=make_request_options(
94+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
95+
),
96+
cast_to=FileStatusResponse,
7797
)
7898

7999

@@ -97,19 +117,19 @@ def with_streaming_response(self) -> AsyncFileResourceWithStreamingResponse:
97117
"""
98118
return AsyncFileResourceWithStreamingResponse(self)
99119

100-
async def search(
120+
async def read(
101121
self,
102122
*,
103-
query: str,
123+
path: str,
104124
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
105125
# The extra values given here take precedence over values defined on the client or passed to this method.
106126
extra_headers: Headers | None = None,
107127
extra_query: Query | None = None,
108128
extra_body: Body | None = None,
109129
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
110-
) -> FileSearchResponse:
130+
) -> FileReadResponse:
111131
"""
112-
Search for files
132+
Read a file
113133
114134
Args:
115135
extra_headers: Send extra headers
@@ -127,43 +147,74 @@ async def search(
127147
extra_query=extra_query,
128148
extra_body=extra_body,
129149
timeout=timeout,
130-
query=await async_maybe_transform({"query": query}, file_search_params.FileSearchParams),
150+
query=await async_maybe_transform({"path": path}, file_read_params.FileReadParams),
151+
),
152+
cast_to=FileReadResponse,
153+
)
154+
155+
async def status(
156+
self,
157+
*,
158+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
159+
# The extra values given here take precedence over values defined on the client or passed to this method.
160+
extra_headers: Headers | None = None,
161+
extra_query: Query | None = None,
162+
extra_body: Body | None = None,
163+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
164+
) -> FileStatusResponse:
165+
"""Get file status"""
166+
return await self._get(
167+
"/file/status",
168+
options=make_request_options(
169+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
131170
),
132-
cast_to=FileSearchResponse,
171+
cast_to=FileStatusResponse,
133172
)
134173

135174

136175
class FileResourceWithRawResponse:
137176
def __init__(self, file: FileResource) -> None:
138177
self._file = file
139178

140-
self.search = to_raw_response_wrapper(
141-
file.search,
179+
self.read = to_raw_response_wrapper(
180+
file.read,
181+
)
182+
self.status = to_raw_response_wrapper(
183+
file.status,
142184
)
143185

144186

145187
class AsyncFileResourceWithRawResponse:
146188
def __init__(self, file: AsyncFileResource) -> None:
147189
self._file = file
148190

149-
self.search = async_to_raw_response_wrapper(
150-
file.search,
191+
self.read = async_to_raw_response_wrapper(
192+
file.read,
193+
)
194+
self.status = async_to_raw_response_wrapper(
195+
file.status,
151196
)
152197

153198

154199
class FileResourceWithStreamingResponse:
155200
def __init__(self, file: FileResource) -> None:
156201
self._file = file
157202

158-
self.search = to_streamed_response_wrapper(
159-
file.search,
203+
self.read = to_streamed_response_wrapper(
204+
file.read,
205+
)
206+
self.status = to_streamed_response_wrapper(
207+
file.status,
160208
)
161209

162210

163211
class AsyncFileResourceWithStreamingResponse:
164212
def __init__(self, file: AsyncFileResource) -> None:
165213
self._file = file
166214

167-
self.search = async_to_streamed_response_wrapper(
168-
file.search,
215+
self.read = async_to_streamed_response_wrapper(
216+
file.read,
217+
)
218+
self.status = async_to_streamed_response_wrapper(
219+
file.status,
169220
)

0 commit comments

Comments
 (0)