Skip to content

Commit 9002768

Browse files
feat(api): api update
1 parent 45b4e60 commit 9002768

File tree

7 files changed

+31
-23
lines changed

7 files changed

+31
-23
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 26
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/opencode%2Fopencode-fb4caa8d0381531c44dd2d3c8c0b930b8c15a7bdde474d15bf7aeeb3b27aef56.yml
3-
openapi_spec_hash: 3a263e46f2369eeb2410430001c60d15
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/opencode%2Fopencode-5748199af356c3243a46a466e73b5d0bab7eaa0c56895e1d0f903d637f61d0bb.yml
3+
openapi_spec_hash: c04f6b6be54b05d9b1283c24e870163b
44
config_hash: 1ae82c93499b9f0b9ba828b8919f9cb3

api.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ Types:
2323
```python
2424
from opencode_ai.types import (
2525
App,
26-
LogLevel,
2726
Mode,
2827
Model,
2928
Provider,

src/opencode_ai/resources/app.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
from __future__ import annotations
44

55
from typing import Dict
6+
from typing_extensions import Literal
67

78
import httpx
89

9-
from ..types import LogLevel, app_log_params
10+
from ..types import app_log_params
1011
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
1112
from .._utils import maybe_transform, async_maybe_transform
1213
from .._compat import cached_property
@@ -19,7 +20,6 @@
1920
)
2021
from ..types.app import App
2122
from .._base_client import make_request_options
22-
from ..types.log_level import LogLevel
2323
from ..types.app_log_response import AppLogResponse
2424
from ..types.app_init_response import AppInitResponse
2525
from ..types.app_modes_response import AppModesResponse
@@ -89,7 +89,7 @@ def init(
8989
def log(
9090
self,
9191
*,
92-
level: LogLevel,
92+
level: Literal["debug", "info", "error", "warn"],
9393
message: str,
9494
service: str,
9595
extra: Dict[str, object] | NotGiven = NOT_GIVEN,
@@ -237,7 +237,7 @@ async def init(
237237
async def log(
238238
self,
239239
*,
240-
level: LogLevel,
240+
level: Literal["debug", "info", "error", "warn"],
241241
message: str,
242242
service: str,
243243
extra: Dict[str, object] | NotGiven = NOT_GIVEN,

src/opencode_ai/types/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
from .session import Session as Session
2020
from .provider import Provider as Provider
2121
from .file_part import FilePart as FilePart
22-
from .log_level import LogLevel as LogLevel
2322
from .text_part import TextPart as TextPart
2423
from .tool_part import ToolPart as ToolPart
2524
from .file_source import FileSource as FileSource

src/opencode_ai/types/app_log_params.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@
33
from __future__ import annotations
44

55
from typing import Dict
6-
from typing_extensions import Required, TypedDict
7-
8-
from .log_level import LogLevel
6+
from typing_extensions import Literal, Required, TypedDict
97

108
__all__ = ["AppLogParams"]
119

1210

1311
class AppLogParams(TypedDict, total=False):
14-
level: Required[LogLevel]
12+
level: Required[Literal["debug", "info", "error", "warn"]]
1513
"""Log level"""
1614

1715
message: Required[str]

src/opencode_ai/types/log_level.py

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/opencode_ai/types/part.py

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,37 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import Union
4-
from typing_extensions import Annotated, TypeAlias
3+
from typing import List, Union
4+
from typing_extensions import Literal, Annotated, TypeAlias
5+
6+
from pydantic import Field as FieldInfo
57

68
from .._utils import PropertyInfo
9+
from .._models import BaseModel
710
from .file_part import FilePart
811
from .text_part import TextPart
912
from .tool_part import ToolPart
1013
from .snapshot_part import SnapshotPart
1114
from .step_start_part import StepStartPart
1215
from .step_finish_part import StepFinishPart
1316

14-
__all__ = ["Part"]
17+
__all__ = ["Part", "PatchPart"]
18+
19+
20+
class PatchPart(BaseModel):
21+
id: str
22+
23+
files: List[str]
24+
25+
hash: str
26+
27+
message_id: str = FieldInfo(alias="messageID")
28+
29+
session_id: str = FieldInfo(alias="sessionID")
30+
31+
type: Literal["patch"]
32+
1533

1634
Part: TypeAlias = Annotated[
17-
Union[TextPart, FilePart, ToolPart, StepStartPart, StepFinishPart, SnapshotPart], PropertyInfo(discriminator="type")
35+
Union[TextPart, FilePart, ToolPart, StepStartPart, StepFinishPart, SnapshotPart, PatchPart],
36+
PropertyInfo(discriminator="type"),
1837
]

0 commit comments

Comments
 (0)