Skip to content

Commit 4c0117a

Browse files
feat(api): api update
1 parent 8b4a7b1 commit 4c0117a

File tree

4 files changed

+34
-3
lines changed

4 files changed

+34
-3
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-1efc45c35b58e88b0550fbb0c7a204ef66522742f87c9e29c76a18b120c0d945.yml
3-
openapi_spec_hash: 5e15d85e4704624f9b13bae1c71aa416
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/opencode%2Fopencode-335697785b44f3928145853339226bd5e8accd5199bb9d79e2a3fd2d8ce62a57.yml
3+
openapi_spec_hash: 74fbaad0fa44496d0d8b11d9b98eab03
44
config_hash: 1ae82c93499b9f0b9ba828b8919f9cb3

src/opencode_ai/types/assistant_message.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ class AssistantMessage(BaseModel):
5959

6060
cost: float
6161

62+
mode: str
63+
6264
api_model_id: str = FieldInfo(alias="modelID")
6365

6466
path: Path

src/opencode_ai/types/config.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"ProviderModels",
2525
"ProviderModelsCost",
2626
"ProviderModelsLimit",
27+
"ProviderOptions",
2728
]
2829

2930

@@ -103,6 +104,19 @@ class ProviderModels(BaseModel):
103104
tool_call: Optional[bool] = None
104105

105106

107+
class ProviderOptions(BaseModel):
108+
api_key: Optional[str] = FieldInfo(alias="apiKey", default=None)
109+
110+
base_url: Optional[str] = FieldInfo(alias="baseURL", default=None)
111+
112+
__pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
113+
if TYPE_CHECKING:
114+
# Stub to indicate that arbitrary properties are accepted.
115+
# To access properties that are not valid identifiers you can use `getattr`, e.g.
116+
# `getattr(obj, '$type')`
117+
def __getattr__(self, attr: str) -> object: ...
118+
119+
106120
class Provider(BaseModel):
107121
models: Dict[str, ProviderModels]
108122

@@ -116,7 +130,7 @@ class Provider(BaseModel):
116130

117131
npm: Optional[str] = None
118132

119-
options: Optional[Dict[str, object]] = None
133+
options: Optional[ProviderOptions] = None
120134

121135

122136
class Config(BaseModel):

src/opencode_ai/types/event_list_response.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
"EventMessageRemovedProperties",
3232
"EventMessagePartUpdated",
3333
"EventMessagePartUpdatedProperties",
34+
"EventMessagePartRemoved",
35+
"EventMessagePartRemovedProperties",
3436
"EventStorageWrite",
3537
"EventStorageWriteProperties",
3638
"EventSessionUpdated",
@@ -136,6 +138,18 @@ class EventMessagePartUpdated(BaseModel):
136138
type: Literal["message.part.updated"]
137139

138140

141+
class EventMessagePartRemovedProperties(BaseModel):
142+
message_id: str = FieldInfo(alias="messageID")
143+
144+
part_id: str = FieldInfo(alias="partID")
145+
146+
147+
class EventMessagePartRemoved(BaseModel):
148+
properties: EventMessagePartRemovedProperties
149+
150+
type: Literal["message.part.removed"]
151+
152+
139153
class EventStorageWriteProperties(BaseModel):
140154
key: str
141155

@@ -235,6 +249,7 @@ class EventIdeInstalled(BaseModel):
235249
EventMessageUpdated,
236250
EventMessageRemoved,
237251
EventMessagePartUpdated,
252+
EventMessagePartRemoved,
238253
EventStorageWrite,
239254
EventSessionUpdated,
240255
EventSessionDeleted,

0 commit comments

Comments
 (0)