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
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.prism.log
.vscode
_dev

__pycache__
Expand Down
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.32"
".": "0.1.0-alpha.33"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 26
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/opencode%2Fopencode-fb4caa8d0381531c44dd2d3c8c0b930b8c15a7bdde474d15bf7aeeb3b27aef56.yml
openapi_spec_hash: 3a263e46f2369eeb2410430001c60d15
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/opencode%2Fopencode-5748199af356c3243a46a466e73b5d0bab7eaa0c56895e1d0f903d637f61d0bb.yml
openapi_spec_hash: c04f6b6be54b05d9b1283c24e870163b
config_hash: 1ae82c93499b9f0b9ba828b8919f9cb3
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"python.analysis.importFormat": "relative",
}
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 0.1.0-alpha.33 (2025-07-25)

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

### Features

* **api:** api update ([9002768](https://github.com/sst/opencode-sdk-python/commit/9002768edd617a44d4d686dd9e88f41fe6a56f2f))


### Chores

* **project:** add settings file for vscode ([7fff9af](https://github.com/sst/opencode-sdk-python/commit/7fff9af8fd66865dc933dce74f0385250377af87))

## 0.1.0-alpha.32 (2025-07-24)

Full Changelog: [v0.1.0-alpha.31...v0.1.0-alpha.32](https://github.com/sst/opencode-sdk-python/compare/v0.1.0-alpha.31...v0.1.0-alpha.32)
Expand Down
1 change: 0 additions & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ Types:
```python
from opencode_ai.types import (
App,
LogLevel,
Mode,
Model,
Provider,
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.32"
version = "0.1.0-alpha.33"
description = "The official Python library for the opencode API"
dynamic = ["readme"]
license = "MIT"
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.32" # x-release-please-version
__version__ = "0.1.0-alpha.33" # x-release-please-version
8 changes: 4 additions & 4 deletions src/opencode_ai/resources/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
from __future__ import annotations

from typing import Dict
from typing_extensions import Literal

import httpx

from ..types import LogLevel, app_log_params
from ..types import app_log_params
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from .._utils import maybe_transform, async_maybe_transform
from .._compat import cached_property
Expand All @@ -19,7 +20,6 @@
)
from ..types.app import App
from .._base_client import make_request_options
from ..types.log_level import LogLevel
from ..types.app_log_response import AppLogResponse
from ..types.app_init_response import AppInitResponse
from ..types.app_modes_response import AppModesResponse
Expand Down Expand Up @@ -89,7 +89,7 @@ def init(
def log(
self,
*,
level: LogLevel,
level: Literal["debug", "info", "error", "warn"],
message: str,
service: str,
extra: Dict[str, object] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -237,7 +237,7 @@ async def init(
async def log(
self,
*,
level: LogLevel,
level: Literal["debug", "info", "error", "warn"],
message: str,
service: str,
extra: Dict[str, object] | NotGiven = NOT_GIVEN,
Expand Down
1 change: 0 additions & 1 deletion src/opencode_ai/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from .session import Session as Session
from .provider import Provider as Provider
from .file_part import FilePart as FilePart
from .log_level import LogLevel as LogLevel
from .text_part import TextPart as TextPart
from .tool_part import ToolPart as ToolPart
from .file_source import FileSource as FileSource
Expand Down
6 changes: 2 additions & 4 deletions src/opencode_ai/types/app_log_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@
from __future__ import annotations

from typing import Dict
from typing_extensions import Required, TypedDict

from .log_level import LogLevel
from typing_extensions import Literal, Required, TypedDict

__all__ = ["AppLogParams"]


class AppLogParams(TypedDict, total=False):
level: Required[LogLevel]
level: Required[Literal["debug", "info", "error", "warn"]]
"""Log level"""

message: Required[str]
Expand Down
7 changes: 0 additions & 7 deletions src/opencode_ai/types/log_level.py

This file was deleted.

27 changes: 23 additions & 4 deletions src/opencode_ai/types/part.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,37 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import Union
from typing_extensions import Annotated, TypeAlias
from typing import List, Union
from typing_extensions import Literal, Annotated, TypeAlias

from pydantic import Field as FieldInfo

from .._utils import PropertyInfo
from .._models import BaseModel
from .file_part import FilePart
from .text_part import TextPart
from .tool_part import ToolPart
from .snapshot_part import SnapshotPart
from .step_start_part import StepStartPart
from .step_finish_part import StepFinishPart

__all__ = ["Part"]
__all__ = ["Part", "PatchPart"]


class PatchPart(BaseModel):
id: str

files: List[str]

hash: str

message_id: str = FieldInfo(alias="messageID")

session_id: str = FieldInfo(alias="sessionID")

type: Literal["patch"]


Part: TypeAlias = Annotated[
Union[TextPart, FilePart, ToolPart, StepStartPart, StepFinishPart, SnapshotPart], PropertyInfo(discriminator="type")
Union[TextPart, FilePart, ToolPart, StepStartPart, StepFinishPart, SnapshotPart, PatchPart],
PropertyInfo(discriminator="type"),
]