| 204 | |
| 205 | |
| 206 | class AsyncOpencode(AsyncAPIClient): |
| 207 | event: event.AsyncEventResource |
| 208 | app: app.AsyncAppResource |
| 209 | find: find.AsyncFindResource |
| 210 | file: file.AsyncFileResource |
| 211 | config: config.AsyncConfigResource |
| 212 | session: session.AsyncSessionResource |
| 213 | tui: tui.AsyncTuiResource |
| 214 | with_raw_response: AsyncOpencodeWithRawResponse |
| 215 | with_streaming_response: AsyncOpencodeWithStreamedResponse |
| 216 | |
| 217 | # client options |
| 218 | |
| 219 | def __init__( |
| 220 | self, |
| 221 | *, |
| 222 | base_url: str | httpx.URL | None = None, |
| 223 | timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN, |
| 224 | max_retries: int = DEFAULT_MAX_RETRIES, |
| 225 | default_headers: Mapping[str, str] | None = None, |
| 226 | default_query: Mapping[str, object] | None = None, |
| 227 | # Configure a custom httpx client. |
| 228 | # We provide a `DefaultAsyncHttpxClient` class that you can pass to retain the default values we use for `limits`, `timeout` & `follow_redirects`. |
| 229 | # See the [httpx documentation](https://www.python-httpx.org/api/#asyncclient) for more details. |
| 230 | http_client: httpx.AsyncClient | None = None, |
| 231 | # Enable or disable schema validation for data returned by the API. |
| 232 | # When enabled an error APIResponseValidationError is raised |
| 233 | # if the API responds with invalid data for the expected schema. |
| 234 | # |
| 235 | # This parameter may be removed or changed in the future. |
| 236 | # If you rely on this feature, please open a GitHub issue |
| 237 | # outlining your use-case to help us decide if it should be |
| 238 | # part of our public interface in the future. |
| 239 | _strict_response_validation: bool = False, |
| 240 | ) -> None: |
| 241 | """Construct a new async AsyncOpencode client instance.""" |
| 242 | if base_url is None: |
| 243 | base_url = os.environ.get("OPENCODE_BASE_URL") |
| 244 | if base_url is None: |
| 245 | base_url = f"http://localhost:54321" |
| 246 | |
| 247 | super().__init__( |
| 248 | version=__version__, |
| 249 | base_url=base_url, |
| 250 | max_retries=max_retries, |
| 251 | timeout=timeout, |
| 252 | http_client=http_client, |
| 253 | custom_headers=default_headers, |
| 254 | custom_query=default_query, |
| 255 | _strict_response_validation=_strict_response_validation, |
| 256 | ) |
| 257 | |
| 258 | self._default_stream_cls = AsyncStream |
| 259 | |
| 260 | self.event = event.AsyncEventResource(self) |
| 261 | self.app = app.AsyncAppResource(self) |
| 262 | self.find = find.AsyncFindResource(self) |
| 263 | self.file = file.AsyncFileResource(self) |
no outgoing calls