Skip to content

Commit 773bf59

Browse files
authored
Merge pull request #9 from onkernel/release-please--branches--main--changes--next
release: 0.1.0-alpha.7
2 parents 4d7884a + f14738b commit 773bf59

File tree

11 files changed

+215
-14
lines changed

11 files changed

+215
-14
lines changed

.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.1.0-alpha.6"
2+
".": "0.1.0-alpha.7"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 3
1+
configured_endpoints: 4
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-d168b58fcf39dbd0458d132091793d3e2d0930070b7dda2d5f7f1baff20dd31b.yml
33
openapi_spec_hash: b7e0fd7ee1656d7dbad57209d1584d92
4-
config_hash: 9139d1eb064baf60fd2265aac382f097
4+
config_hash: eab40627b734534462ae3b8ccd8b263b

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.1.0-alpha.7 (2025-05-11)
4+
5+
Full Changelog: [v0.1.0-alpha.6...v0.1.0-alpha.7](https://github.com/onkernel/kernel-python-sdk/compare/v0.1.0-alpha.6...v0.1.0-alpha.7)
6+
7+
### Features
8+
9+
* **api:** update via SDK Studio ([2810c5c](https://github.com/onkernel/kernel-python-sdk/commit/2810c5c0e0e0e89e03a00b27fb1d2ab355f3a8ff))
10+
311
## 0.1.0-alpha.6 (2025-05-11)
412

513
Full Changelog: [v0.1.0-alpha.5...v0.1.0-alpha.6](https://github.com/onkernel/kernel-python-sdk/compare/v0.1.0-alpha.5...v0.1.0-alpha.6)

api.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
Types:
44

55
```python
6-
from kernel.types import AppDeployResponse, AppInvokeResponse
6+
from kernel.types import AppDeployResponse, AppInvokeResponse, AppRetrieveInvocationResponse
77
```
88

99
Methods:
1010

1111
- <code title="post /apps/deploy">client.apps.<a href="./src/kernel/resources/apps.py">deploy</a>(\*\*<a href="src/kernel/types/app_deploy_params.py">params</a>) -> <a href="./src/kernel/types/app_deploy_response.py">AppDeployResponse</a></code>
1212
- <code title="post /apps/invoke">client.apps.<a href="./src/kernel/resources/apps.py">invoke</a>(\*\*<a href="src/kernel/types/app_invoke_params.py">params</a>) -> <a href="./src/kernel/types/app_invoke_response.py">AppInvokeResponse</a></code>
13+
- <code title="get /apps/invocations/{id}">client.apps.<a href="./src/kernel/resources/apps.py">retrieve_invocation</a>(id) -> <a href="./src/kernel/types/app_retrieve_invocation_response.py">AppRetrieveInvocationResponse</a></code>
1314

1415
# Browser
1516

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.1.0-alpha.6"
3+
version = "0.1.0-alpha.7"
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.1.0-alpha.6" # x-release-please-version
4+
__version__ = "0.1.0-alpha.7" # x-release-please-version

src/kernel/app_framework.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ class KernelAppJson:
3535
class KernelJson:
3636
"""JSON representation of Kernel manifest"""
3737
apps: List[KernelAppJson]
38-
entrypoint: str
3938

4039
# App class
4140
class KernelApp:
@@ -127,14 +126,14 @@ def get_apps(self) -> List[KernelApp]:
127126
def get_app_by_name(self, name: str) -> Optional[KernelApp]:
128127
return self.apps.get(name)
129128

130-
def export(self, entrypoint_relpath: str) -> KernelJson:
129+
def export(self) -> KernelJson:
131130
"""Export the registry as a KernelJson object"""
132131
apps = [app.to_dict() for app in self.get_apps()]
133-
return KernelJson(apps=apps, entrypoint=entrypoint_relpath)
132+
return KernelJson(apps=apps)
134133

135-
def export_json(self, entrypoint_relpath: str) -> str:
134+
def export_json(self) -> str:
136135
"""Export the registry as JSON"""
137-
kernel_json = self.export(entrypoint_relpath)
136+
kernel_json = self.export()
138137
return json.dumps(kernel_json.__dict__, indent=2)
139138

140139

@@ -150,6 +149,6 @@ def App(name: str) -> KernelApp:
150149
app_registry = _app_registry
151150

152151
# Function to export registry as JSON
153-
def export_registry(entrypoint_relpath: str) -> str:
152+
def export_registry() -> str:
154153
"""Export the registry as JSON"""
155-
return _app_registry.export_json(entrypoint_relpath)
154+
return _app_registry.export_json()

src/kernel/resources/apps.py

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from .._base_client import make_request_options
2121
from ..types.app_deploy_response import AppDeployResponse
2222
from ..types.app_invoke_response import AppInvokeResponse
23+
from ..types.app_retrieve_invocation_response import AppRetrieveInvocationResponse
2324

2425
__all__ = ["AppsResource", "AsyncAppsResource"]
2526

@@ -152,6 +153,39 @@ def invoke(
152153
cast_to=AppInvokeResponse,
153154
)
154155

156+
def retrieve_invocation(
157+
self,
158+
id: str,
159+
*,
160+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
161+
# The extra values given here take precedence over values defined on the client or passed to this method.
162+
extra_headers: Headers | None = None,
163+
extra_query: Query | None = None,
164+
extra_body: Body | None = None,
165+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
166+
) -> AppRetrieveInvocationResponse:
167+
"""
168+
Get an app invocation by id
169+
170+
Args:
171+
extra_headers: Send extra headers
172+
173+
extra_query: Add additional query parameters to the request
174+
175+
extra_body: Add additional JSON properties to the request
176+
177+
timeout: Override the client-level default timeout for this request, in seconds
178+
"""
179+
if not id:
180+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
181+
return self._get(
182+
f"/apps/invocations/{id}",
183+
options=make_request_options(
184+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
185+
),
186+
cast_to=AppRetrieveInvocationResponse,
187+
)
188+
155189

156190
class AsyncAppsResource(AsyncAPIResource):
157191
@cached_property
@@ -281,6 +315,39 @@ async def invoke(
281315
cast_to=AppInvokeResponse,
282316
)
283317

318+
async def retrieve_invocation(
319+
self,
320+
id: str,
321+
*,
322+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
323+
# The extra values given here take precedence over values defined on the client or passed to this method.
324+
extra_headers: Headers | None = None,
325+
extra_query: Query | None = None,
326+
extra_body: Body | None = None,
327+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
328+
) -> AppRetrieveInvocationResponse:
329+
"""
330+
Get an app invocation by id
331+
332+
Args:
333+
extra_headers: Send extra headers
334+
335+
extra_query: Add additional query parameters to the request
336+
337+
extra_body: Add additional JSON properties to the request
338+
339+
timeout: Override the client-level default timeout for this request, in seconds
340+
"""
341+
if not id:
342+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
343+
return await self._get(
344+
f"/apps/invocations/{id}",
345+
options=make_request_options(
346+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
347+
),
348+
cast_to=AppRetrieveInvocationResponse,
349+
)
350+
284351

285352
class AppsResourceWithRawResponse:
286353
def __init__(self, apps: AppsResource) -> None:
@@ -292,6 +359,9 @@ def __init__(self, apps: AppsResource) -> None:
292359
self.invoke = to_raw_response_wrapper(
293360
apps.invoke,
294361
)
362+
self.retrieve_invocation = to_raw_response_wrapper(
363+
apps.retrieve_invocation,
364+
)
295365

296366

297367
class AsyncAppsResourceWithRawResponse:
@@ -304,6 +374,9 @@ def __init__(self, apps: AsyncAppsResource) -> None:
304374
self.invoke = async_to_raw_response_wrapper(
305375
apps.invoke,
306376
)
377+
self.retrieve_invocation = async_to_raw_response_wrapper(
378+
apps.retrieve_invocation,
379+
)
307380

308381

309382
class AppsResourceWithStreamingResponse:
@@ -316,6 +389,9 @@ def __init__(self, apps: AppsResource) -> None:
316389
self.invoke = to_streamed_response_wrapper(
317390
apps.invoke,
318391
)
392+
self.retrieve_invocation = to_streamed_response_wrapper(
393+
apps.retrieve_invocation,
394+
)
319395

320396

321397
class AsyncAppsResourceWithStreamingResponse:
@@ -328,3 +404,6 @@ def __init__(self, apps: AsyncAppsResource) -> None:
328404
self.invoke = async_to_streamed_response_wrapper(
329405
apps.invoke,
330406
)
407+
self.retrieve_invocation = async_to_streamed_response_wrapper(
408+
apps.retrieve_invocation,
409+
)

src/kernel/types/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
from .app_deploy_response import AppDeployResponse as AppDeployResponse
88
from .app_invoke_response import AppInvokeResponse as AppInvokeResponse
99
from .browser_create_session_response import BrowserCreateSessionResponse as BrowserCreateSessionResponse
10+
from .app_retrieve_invocation_response import AppRetrieveInvocationResponse as AppRetrieveInvocationResponse
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing import Optional
4+
5+
from pydantic import Field as FieldInfo
6+
7+
from .._models import BaseModel
8+
9+
__all__ = ["AppRetrieveInvocationResponse"]
10+
11+
12+
class AppRetrieveInvocationResponse(BaseModel):
13+
id: str
14+
15+
app_name: str = FieldInfo(alias="appName")
16+
17+
finished_at: Optional[str] = FieldInfo(alias="finishedAt", default=None)
18+
19+
input: str
20+
21+
output: str
22+
23+
started_at: str = FieldInfo(alias="startedAt")
24+
25+
status: str

0 commit comments

Comments
 (0)