Skip to content

Commit 1db1825

Browse files
authored
Merge pull request #22 from onkernel/release-please--branches--main--changes--next
release: 0.4.0
2 parents e3cc9f5 + 07fce67 commit 1db1825

File tree

13 files changed

+336
-11
lines changed

13 files changed

+336
-11
lines changed

.cursor/environment.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"snapshot": "snapshot-20250522-bd1c3d88-262b-44dc-bd01-cb8e8b262337",
3+
"install": "export GOPRIVATE=github.com/onkernel/kernel-go-sdk;\n\n/bin/bash -c \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\"\n",
4+
"terminals": []
5+
}

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.3.0"
2+
".": "0.4.0"
33
}

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 10
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-3edc7a0eef4a0d4495782efbdb0d9b777a55aee058dab119f90de56019441326.yml
3-
openapi_spec_hash: dff0b1efa1c1614cf770ed8327cefab2
4-
config_hash: cb04a4d88ee9f530b303ca57ff7090b3
1+
configured_endpoints: 11
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-64ccdff4ca5d73d79d89e817fe83ccfd3d529696df3e6818c3c75e586ae00801.yml
3+
openapi_spec_hash: 21c7b8757fc0cc9415cda1bc06251de6
4+
config_hash: b3fcacd707da56b21d31ce0baf4fb87d

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 0.4.0 (2025-05-28)
4+
5+
Full Changelog: [v0.3.0...v0.4.0](https://github.com/onkernel/kernel-python-sdk/compare/v0.3.0...v0.4.0)
6+
7+
### Features
8+
9+
* **api:** update via SDK Studio ([eda6c2c](https://github.com/onkernel/kernel-python-sdk/commit/eda6c2c9ec1f585b8546c629bb661f0f9a9e9c04))
10+
311
## 0.3.0 (2025-05-22)
412

513
Full Changelog: [v0.2.0...v0.3.0](https://github.com/onkernel/kernel-python-sdk/compare/v0.2.0...v0.3.0)

api.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,18 @@ Methods:
2828
Types:
2929

3030
```python
31-
from kernel.types.apps import InvocationCreateResponse, InvocationRetrieveResponse
31+
from kernel.types.apps import (
32+
InvocationCreateResponse,
33+
InvocationRetrieveResponse,
34+
InvocationUpdateResponse,
35+
)
3236
```
3337

3438
Methods:
3539

3640
- <code title="post /invocations">client.apps.invocations.<a href="./src/kernel/resources/apps/invocations.py">create</a>(\*\*<a href="src/kernel/types/apps/invocation_create_params.py">params</a>) -> <a href="./src/kernel/types/apps/invocation_create_response.py">InvocationCreateResponse</a></code>
3741
- <code title="get /invocations/{id}">client.apps.invocations.<a href="./src/kernel/resources/apps/invocations.py">retrieve</a>(id) -> <a href="./src/kernel/types/apps/invocation_retrieve_response.py">InvocationRetrieveResponse</a></code>
42+
- <code title="patch /invocations/{id}">client.apps.invocations.<a href="./src/kernel/resources/apps/invocations.py">update</a>(id, \*\*<a href="src/kernel/types/apps/invocation_update_params.py">params</a>) -> <a href="./src/kernel/types/apps/invocation_update_response.py">InvocationUpdateResponse</a></code>
3843

3944
# Browsers
4045

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "kernel"
3-
version = "0.3.0"
3+
version = "0.4.0"
44
description = "The official Python library for the kernel API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"

src/kernel/_version.py

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

33
__title__ = "kernel"
4-
__version__ = "0.3.0" # x-release-please-version
4+
__version__ = "0.4.0" # x-release-please-version

src/kernel/resources/apps/invocations.py

Lines changed: 118 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
from __future__ import annotations
44

5+
from typing_extensions import Literal
6+
57
import httpx
68

79
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
@@ -14,9 +16,10 @@
1416
async_to_raw_response_wrapper,
1517
async_to_streamed_response_wrapper,
1618
)
17-
from ...types.apps import invocation_create_params
19+
from ...types.apps import invocation_create_params, invocation_update_params
1820
from ..._base_client import make_request_options
1921
from ...types.apps.invocation_create_response import InvocationCreateResponse
22+
from ...types.apps.invocation_update_response import InvocationUpdateResponse
2023
from ...types.apps.invocation_retrieve_response import InvocationRetrieveResponse
2124

2225
__all__ = ["InvocationsResource", "AsyncInvocationsResource"]
@@ -48,6 +51,7 @@ def create(
4851
action_name: str,
4952
app_name: str,
5053
version: str,
54+
async_: bool | NotGiven = NOT_GIVEN,
5155
payload: str | NotGiven = NOT_GIVEN,
5256
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5357
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -66,6 +70,9 @@ def create(
6670
6771
version: Version of the application
6872
73+
async_: If true, invoke asynchronously. When set, the API responds 202 Accepted with
74+
status "queued".
75+
6976
payload: Input data for the action, sent as a JSON string.
7077
7178
extra_headers: Send extra headers
@@ -83,6 +90,7 @@ def create(
8390
"action_name": action_name,
8491
"app_name": app_name,
8592
"version": version,
93+
"async_": async_,
8694
"payload": payload,
8795
},
8896
invocation_create_params.InvocationCreateParams,
@@ -126,6 +134,52 @@ def retrieve(
126134
cast_to=InvocationRetrieveResponse,
127135
)
128136

137+
def update(
138+
self,
139+
id: str,
140+
*,
141+
status: Literal["succeeded", "failed"],
142+
output: str | NotGiven = NOT_GIVEN,
143+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
144+
# The extra values given here take precedence over values defined on the client or passed to this method.
145+
extra_headers: Headers | None = None,
146+
extra_query: Query | None = None,
147+
extra_body: Body | None = None,
148+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
149+
) -> InvocationUpdateResponse:
150+
"""
151+
Update invocation status or output
152+
153+
Args:
154+
status: New status for the invocation.
155+
156+
output: Updated output of the invocation rendered as JSON string.
157+
158+
extra_headers: Send extra headers
159+
160+
extra_query: Add additional query parameters to the request
161+
162+
extra_body: Add additional JSON properties to the request
163+
164+
timeout: Override the client-level default timeout for this request, in seconds
165+
"""
166+
if not id:
167+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
168+
return self._patch(
169+
f"/invocations/{id}",
170+
body=maybe_transform(
171+
{
172+
"status": status,
173+
"output": output,
174+
},
175+
invocation_update_params.InvocationUpdateParams,
176+
),
177+
options=make_request_options(
178+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
179+
),
180+
cast_to=InvocationUpdateResponse,
181+
)
182+
129183

130184
class AsyncInvocationsResource(AsyncAPIResource):
131185
@cached_property
@@ -153,6 +207,7 @@ async def create(
153207
action_name: str,
154208
app_name: str,
155209
version: str,
210+
async_: bool | NotGiven = NOT_GIVEN,
156211
payload: str | NotGiven = NOT_GIVEN,
157212
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
158213
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -171,6 +226,9 @@ async def create(
171226
172227
version: Version of the application
173228
229+
async_: If true, invoke asynchronously. When set, the API responds 202 Accepted with
230+
status "queued".
231+
174232
payload: Input data for the action, sent as a JSON string.
175233
176234
extra_headers: Send extra headers
@@ -188,6 +246,7 @@ async def create(
188246
"action_name": action_name,
189247
"app_name": app_name,
190248
"version": version,
249+
"async_": async_,
191250
"payload": payload,
192251
},
193252
invocation_create_params.InvocationCreateParams,
@@ -231,6 +290,52 @@ async def retrieve(
231290
cast_to=InvocationRetrieveResponse,
232291
)
233292

293+
async def update(
294+
self,
295+
id: str,
296+
*,
297+
status: Literal["succeeded", "failed"],
298+
output: str | NotGiven = NOT_GIVEN,
299+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
300+
# The extra values given here take precedence over values defined on the client or passed to this method.
301+
extra_headers: Headers | None = None,
302+
extra_query: Query | None = None,
303+
extra_body: Body | None = None,
304+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
305+
) -> InvocationUpdateResponse:
306+
"""
307+
Update invocation status or output
308+
309+
Args:
310+
status: New status for the invocation.
311+
312+
output: Updated output of the invocation rendered as JSON string.
313+
314+
extra_headers: Send extra headers
315+
316+
extra_query: Add additional query parameters to the request
317+
318+
extra_body: Add additional JSON properties to the request
319+
320+
timeout: Override the client-level default timeout for this request, in seconds
321+
"""
322+
if not id:
323+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
324+
return await self._patch(
325+
f"/invocations/{id}",
326+
body=await async_maybe_transform(
327+
{
328+
"status": status,
329+
"output": output,
330+
},
331+
invocation_update_params.InvocationUpdateParams,
332+
),
333+
options=make_request_options(
334+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
335+
),
336+
cast_to=InvocationUpdateResponse,
337+
)
338+
234339

235340
class InvocationsResourceWithRawResponse:
236341
def __init__(self, invocations: InvocationsResource) -> None:
@@ -242,6 +347,9 @@ def __init__(self, invocations: InvocationsResource) -> None:
242347
self.retrieve = to_raw_response_wrapper(
243348
invocations.retrieve,
244349
)
350+
self.update = to_raw_response_wrapper(
351+
invocations.update,
352+
)
245353

246354

247355
class AsyncInvocationsResourceWithRawResponse:
@@ -254,6 +362,9 @@ def __init__(self, invocations: AsyncInvocationsResource) -> None:
254362
self.retrieve = async_to_raw_response_wrapper(
255363
invocations.retrieve,
256364
)
365+
self.update = async_to_raw_response_wrapper(
366+
invocations.update,
367+
)
257368

258369

259370
class InvocationsResourceWithStreamingResponse:
@@ -266,6 +377,9 @@ def __init__(self, invocations: InvocationsResource) -> None:
266377
self.retrieve = to_streamed_response_wrapper(
267378
invocations.retrieve,
268379
)
380+
self.update = to_streamed_response_wrapper(
381+
invocations.update,
382+
)
269383

270384

271385
class AsyncInvocationsResourceWithStreamingResponse:
@@ -278,3 +392,6 @@ def __init__(self, invocations: AsyncInvocationsResource) -> None:
278392
self.retrieve = async_to_streamed_response_wrapper(
279393
invocations.retrieve,
280394
)
395+
self.update = async_to_streamed_response_wrapper(
396+
invocations.update,
397+
)

src/kernel/types/apps/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44

55
from .deployment_create_params import DeploymentCreateParams as DeploymentCreateParams
66
from .invocation_create_params import InvocationCreateParams as InvocationCreateParams
7+
from .invocation_update_params import InvocationUpdateParams as InvocationUpdateParams
78
from .deployment_create_response import DeploymentCreateResponse as DeploymentCreateResponse
89
from .deployment_follow_response import DeploymentFollowResponse as DeploymentFollowResponse
910
from .invocation_create_response import InvocationCreateResponse as InvocationCreateResponse
11+
from .invocation_update_response import InvocationUpdateResponse as InvocationUpdateResponse
1012
from .invocation_retrieve_response import InvocationRetrieveResponse as InvocationRetrieveResponse

src/kernel/types/apps/invocation_create_params.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
from __future__ import annotations
44

5-
from typing_extensions import Required, TypedDict
5+
from typing_extensions import Required, Annotated, TypedDict
6+
7+
from ..._utils import PropertyInfo
68

79
__all__ = ["InvocationCreateParams"]
810

@@ -17,5 +19,11 @@ class InvocationCreateParams(TypedDict, total=False):
1719
version: Required[str]
1820
"""Version of the application"""
1921

22+
async_: Annotated[bool, PropertyInfo(alias="async")]
23+
"""If true, invoke asynchronously.
24+
25+
When set, the API responds 202 Accepted with status "queued".
26+
"""
27+
2028
payload: str
2129
"""Input data for the action, sent as a JSON string."""

0 commit comments

Comments
 (0)