Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.0-alpha.18"
".": "0.1.0-alpha.19"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/opencode%2Fopencode-8792f91dd070f7b4ee671fc86e8a03976dc7fb6ee49f8c99ad989e1597003774.yml
openapi_spec_hash: fe9dc3a074be560de0b97df9b5af2c1b
config_hash: 2a888f284ea87b2dfdb7e548938a55ea
config_hash: b7f3d9742335715c458494988498b183
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.1.0-alpha.19 (2025-07-16)

Full Changelog: [v0.1.0-alpha.18...v0.1.0-alpha.19](https://github.com/sst/opencode-sdk-python/compare/v0.1.0-alpha.18...v0.1.0-alpha.19)

### Features

* **api:** api update ([07b8550](https://github.com/sst/opencode-sdk-python/commit/07b8550e658373298ac5d64eed102f21d03a29fa))

## 0.1.0-alpha.18 (2025-07-16)

Full Changelog: [v0.1.0-alpha.17...v0.1.0-alpha.18](https://github.com/sst/opencode-sdk-python/compare/v0.1.0-alpha.17...v0.1.0-alpha.18)
Expand Down
26 changes: 17 additions & 9 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,17 @@ Methods:
Types:

```python
from opencode_ai.types import App, LogLevel, Mode, AppInitResponse, AppLogResponse, AppModesResponse
from opencode_ai.types import (
App,
LogLevel,
Mode,
Model,
Provider,
AppInitResponse,
AppLogResponse,
AppModesResponse,
AppProvidersResponse,
)
```

Methods:
Expand All @@ -30,6 +40,7 @@ Methods:
- <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>
- <code title="post /log">client.app.<a href="./src/opencode_ai/resources/app.py">log</a>(\*\*<a href="src/opencode_ai/types/app_log_params.py">params</a>) -> <a href="./src/opencode_ai/types/app_log_response.py">AppLogResponse</a></code>
- <code title="get /mode">client.app.<a href="./src/opencode_ai/resources/app.py">modes</a>() -> <a href="./src/opencode_ai/types/app_modes_response.py">AppModesResponse</a></code>
- <code title="get /config/providers">client.app.<a href="./src/opencode_ai/resources/app.py">providers</a>() -> <a href="./src/opencode_ai/types/app_providers_response.py">AppProvidersResponse</a></code>

# Find

Expand Down Expand Up @@ -71,20 +82,17 @@ Types:
```python
from opencode_ai.types import (
Config,
Keybinds,
McpLocal,
McpRemote,
Mode,
Model,
Provider,
ConfigProvidersResponse,
KeybindsConfig,
LayoutConfig,
McpLocalConfig,
McpRemoteConfig,
ModeConfig,
)
```

Methods:

- <code title="get /config">client.config.<a href="./src/opencode_ai/resources/config.py">get</a>() -> <a href="./src/opencode_ai/types/config.py">Config</a></code>
- <code title="get /config/providers">client.config.<a href="./src/opencode_ai/resources/config.py">providers</a>() -> <a href="./src/opencode_ai/types/config_providers_response.py">ConfigProvidersResponse</a></code>

# Session

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "opencode-ai"
version = "0.1.0-alpha.18"
version = "0.1.0-alpha.19"
description = "The official Python library for the opencode API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/opencode_ai/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "opencode_ai"
__version__ = "0.1.0-alpha.18" # x-release-please-version
__version__ = "0.1.0-alpha.19" # x-release-please-version
51 changes: 51 additions & 0 deletions src/opencode_ai/resources/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from ..types.app_log_response import AppLogResponse
from ..types.app_init_response import AppInitResponse
from ..types.app_modes_response import AppModesResponse
from ..types.app_providers_response import AppProvidersResponse

__all__ = ["AppResource", "AsyncAppResource"]

Expand Down Expand Up @@ -155,6 +156,25 @@ def modes(
cast_to=AppModesResponse,
)

def providers(
self,
*,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AppProvidersResponse:
"""List all providers"""
return self._get(
"/config/providers",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=AppProvidersResponse,
)


class AsyncAppResource(AsyncAPIResource):
@cached_property
Expand Down Expand Up @@ -284,6 +304,25 @@ async def modes(
cast_to=AppModesResponse,
)

async def providers(
self,
*,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AppProvidersResponse:
"""List all providers"""
return await self._get(
"/config/providers",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=AppProvidersResponse,
)


class AppResourceWithRawResponse:
def __init__(self, app: AppResource) -> None:
Expand All @@ -301,6 +340,9 @@ def __init__(self, app: AppResource) -> None:
self.modes = to_raw_response_wrapper(
app.modes,
)
self.providers = to_raw_response_wrapper(
app.providers,
)


class AsyncAppResourceWithRawResponse:
Expand All @@ -319,6 +361,9 @@ def __init__(self, app: AsyncAppResource) -> None:
self.modes = async_to_raw_response_wrapper(
app.modes,
)
self.providers = async_to_raw_response_wrapper(
app.providers,
)


class AppResourceWithStreamingResponse:
Expand All @@ -337,6 +382,9 @@ def __init__(self, app: AppResource) -> None:
self.modes = to_streamed_response_wrapper(
app.modes,
)
self.providers = to_streamed_response_wrapper(
app.providers,
)


class AsyncAppResourceWithStreamingResponse:
Expand All @@ -355,3 +403,6 @@ def __init__(self, app: AsyncAppResource) -> None:
self.modes = async_to_streamed_response_wrapper(
app.modes,
)
self.providers = async_to_streamed_response_wrapper(
app.providers,
)
51 changes: 0 additions & 51 deletions src/opencode_ai/resources/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
)
from .._base_client import make_request_options
from ..types.config import Config
from ..types.config_providers_response import ConfigProvidersResponse

__all__ = ["ConfigResource", "AsyncConfigResource"]

Expand Down Expand Up @@ -59,25 +58,6 @@ def get(
cast_to=Config,
)

def providers(
self,
*,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> ConfigProvidersResponse:
"""List all providers"""
return self._get(
"/config/providers",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=ConfigProvidersResponse,
)


class AsyncConfigResource(AsyncAPIResource):
@cached_property
Expand Down Expand Up @@ -118,25 +98,6 @@ async def get(
cast_to=Config,
)

async def providers(
self,
*,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> ConfigProvidersResponse:
"""List all providers"""
return await self._get(
"/config/providers",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=ConfigProvidersResponse,
)


class ConfigResourceWithRawResponse:
def __init__(self, config: ConfigResource) -> None:
Expand All @@ -145,9 +106,6 @@ def __init__(self, config: ConfigResource) -> None:
self.get = to_raw_response_wrapper(
config.get,
)
self.providers = to_raw_response_wrapper(
config.providers,
)


class AsyncConfigResourceWithRawResponse:
Expand All @@ -157,9 +115,6 @@ def __init__(self, config: AsyncConfigResource) -> None:
self.get = async_to_raw_response_wrapper(
config.get,
)
self.providers = async_to_raw_response_wrapper(
config.providers,
)


class ConfigResourceWithStreamingResponse:
Expand All @@ -169,9 +124,6 @@ def __init__(self, config: ConfigResource) -> None:
self.get = to_streamed_response_wrapper(
config.get,
)
self.providers = to_streamed_response_wrapper(
config.providers,
)


class AsyncConfigResourceWithStreamingResponse:
Expand All @@ -181,6 +133,3 @@ def __init__(self, config: AsyncConfigResource) -> None:
self.get = async_to_streamed_response_wrapper(
config.get,
)
self.providers = async_to_streamed_response_wrapper(
config.providers,
)
10 changes: 6 additions & 4 deletions src/opencode_ai/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,30 @@
from .symbol import Symbol as Symbol
from .message import Message as Message
from .session import Session as Session
from .keybinds import Keybinds as Keybinds
from .provider import Provider as Provider
from .file_part import FilePart as FilePart
from .log_level import LogLevel as LogLevel
from .mcp_local import McpLocal as McpLocal
from .text_part import TextPart as TextPart
from .tool_part import ToolPart as ToolPart
from .mcp_remote import McpRemote as McpRemote
from .mode_config import ModeConfig as ModeConfig
from .user_message import UserMessage as UserMessage
from .layout_config import LayoutConfig as LayoutConfig
from .snapshot_part import SnapshotPart as SnapshotPart
from .app_log_params import AppLogParams as AppLogParams
from .file_part_param import FilePartParam as FilePartParam
from .keybinds_config import KeybindsConfig as KeybindsConfig
from .step_start_part import StepStartPart as StepStartPart
from .text_part_param import TextPartParam as TextPartParam
from .app_log_response import AppLogResponse as AppLogResponse
from .file_read_params import FileReadParams as FileReadParams
from .find_text_params import FindTextParams as FindTextParams
from .mcp_local_config import McpLocalConfig as McpLocalConfig
from .step_finish_part import StepFinishPart as StepFinishPart
from .tool_state_error import ToolStateError as ToolStateError
from .app_init_response import AppInitResponse as AppInitResponse
from .assistant_message import AssistantMessage as AssistantMessage
from .find_files_params import FindFilesParams as FindFilesParams
from .mcp_remote_config import McpRemoteConfig as McpRemoteConfig
from .app_modes_response import AppModesResponse as AppModesResponse
from .file_read_response import FileReadResponse as FileReadResponse
from .find_text_response import FindTextResponse as FindTextResponse
Expand All @@ -54,9 +56,9 @@
from .find_symbols_response import FindSymbolsResponse as FindSymbolsResponse
from .session_init_response import SessionInitResponse as SessionInitResponse
from .session_list_response import SessionListResponse as SessionListResponse
from .app_providers_response import AppProvidersResponse as AppProvidersResponse
from .session_abort_response import SessionAbortResponse as SessionAbortResponse
from .session_delete_response import SessionDeleteResponse as SessionDeleteResponse
from .session_summarize_params import SessionSummarizeParams as SessionSummarizeParams
from .config_providers_response import ConfigProvidersResponse as ConfigProvidersResponse
from .session_messages_response import SessionMessagesResponse as SessionMessagesResponse
from .session_summarize_response import SessionSummarizeResponse as SessionSummarizeResponse
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
from .._models import BaseModel
from .provider import Provider

__all__ = ["ConfigProvidersResponse"]
__all__ = ["AppProvidersResponse"]


class ConfigProvidersResponse(BaseModel):
class AppProvidersResponse(BaseModel):
default: Dict[str, str]

providers: List[Provider]
Loading