Skip to content

Commit e428c7f

Browse files
authored
Merge pull request #10 from onkernel/release-please--branches--main--changes--next
release: 0.1.0-alpha.8
2 parents 773bf59 + d16997f commit e428c7f

16 files changed

+168
-124
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.7"
2+
".": "0.1.0-alpha.8"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 4
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-d168b58fcf39dbd0458d132091793d3e2d0930070b7dda2d5f7f1baff20dd31b.yml
3-
openapi_spec_hash: b7e0fd7ee1656d7dbad57209d1584d92
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-2af763aab4c314b382e1123edc4ee3d51c0fe7977730ce6776b9fb09b29fe291.yml
3+
openapi_spec_hash: be02256478be81fa3f649076879850bc
44
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.8 (2025-05-12)
4+
5+
Full Changelog: [v0.1.0-alpha.7...v0.1.0-alpha.8](https://github.com/onkernel/kernel-python-sdk/compare/v0.1.0-alpha.7...v0.1.0-alpha.8)
6+
7+
### Features
8+
9+
* **api:** update via SDK Studio ([68c2cc8](https://github.com/onkernel/kernel-python-sdk/commit/68c2cc821cf9c31f8e5e054ba69780cbba2449db))
10+
311
## 0.1.0-alpha.7 (2025-05-11)
412

513
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)

README.md

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,10 @@ client = Kernel(
3434
)
3535

3636
response = client.apps.deploy(
37-
app_name="REPLACE_ME",
3837
file=b"REPLACE_ME",
3938
version="REPLACE_ME",
4039
)
41-
print(response.id)
40+
print(response.apps)
4241
```
4342

4443
While you can provide an `api_key` keyword argument,
@@ -64,11 +63,10 @@ client = AsyncKernel(
6463

6564
async def main() -> None:
6665
response = await client.apps.deploy(
67-
app_name="REPLACE_ME",
6866
file=b"REPLACE_ME",
6967
version="REPLACE_ME",
7068
)
71-
print(response.id)
69+
print(response.apps)
7270

7371

7472
asyncio.run(main())
@@ -96,9 +94,7 @@ from kernel import Kernel
9694
client = Kernel()
9795

9896
client.apps.deploy(
99-
app_name="my-awesome-app",
10097
file=Path("/path/to/file"),
101-
version="1.0.0",
10298
)
10399
```
104100

@@ -121,7 +117,6 @@ client = Kernel()
121117

122118
try:
123119
client.apps.deploy(
124-
app_name="REPLACE_ME",
125120
file=b"REPLACE_ME",
126121
version="REPLACE_ME",
127122
)
@@ -168,7 +163,6 @@ client = Kernel(
168163

169164
# Or, configure per-request:
170165
client.with_options(max_retries=5).apps.deploy(
171-
app_name="REPLACE_ME",
172166
file=b"REPLACE_ME",
173167
version="REPLACE_ME",
174168
)
@@ -195,7 +189,6 @@ client = Kernel(
195189

196190
# Override per-request:
197191
client.with_options(timeout=5.0).apps.deploy(
198-
app_name="REPLACE_ME",
199192
file=b"REPLACE_ME",
200193
version="REPLACE_ME",
201194
)
@@ -240,14 +233,13 @@ from kernel import Kernel
240233

241234
client = Kernel()
242235
response = client.apps.with_raw_response.deploy(
243-
app_name="REPLACE_ME",
244236
file=b"REPLACE_ME",
245237
version="REPLACE_ME",
246238
)
247239
print(response.headers.get('X-My-Header'))
248240

249241
app = response.parse() # get the object that `apps.deploy()` would have returned
250-
print(app.id)
242+
print(app.apps)
251243
```
252244

253245
These methods return an [`APIResponse`](https://github.com/onkernel/kernel-python-sdk/tree/main/src/kernel/_response.py) object.
@@ -262,7 +254,6 @@ To stream the response body, use `.with_streaming_response` instead, which requi
262254

263255
```python
264256
with client.apps.with_streaming_response.deploy(
265-
app_name="REPLACE_ME",
266257
file=b"REPLACE_ME",
267258
version="REPLACE_ME",
268259
) as response:

api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ from kernel.types import BrowserCreateSessionResponse
2222

2323
Methods:
2424

25-
- <code title="post /browser">client.browser.<a href="./src/kernel/resources/browser.py">create_session</a>() -> <a href="./src/kernel/types/browser_create_session_response.py">BrowserCreateSessionResponse</a></code>
25+
- <code title="post /browser">client.browser.<a href="./src/kernel/resources/browser.py">create_session</a>(\*\*<a href="src/kernel/types/browser_create_session_params.py">params</a>) -> <a href="./src/kernel/types/browser_create_session_response.py">BrowserCreateSessionResponse</a></code>

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

src/kernel/resources/apps.py

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from __future__ import annotations
44

55
from typing import Mapping, cast
6+
from typing_extensions import Literal
67

78
import httpx
89

@@ -48,10 +49,11 @@ def with_streaming_response(self) -> AppsResourceWithStreamingResponse:
4849
def deploy(
4950
self,
5051
*,
51-
app_name: str,
5252
file: FileTypes,
53-
version: str,
54-
region: str | NotGiven = NOT_GIVEN,
53+
entrypoint_rel_path: str | NotGiven = NOT_GIVEN,
54+
force: Literal["true", "false"] | NotGiven = NOT_GIVEN,
55+
region: Literal["aws.us-east-1a"] | NotGiven = NOT_GIVEN,
56+
version: str | NotGiven = NOT_GIVEN,
5557
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5658
# The extra values given here take precedence over values defined on the client or passed to this method.
5759
extra_headers: Headers | None = None,
@@ -63,13 +65,15 @@ def deploy(
6365
Deploy a new application
6466
6567
Args:
66-
app_name: Name of the application
68+
file: ZIP file containing the application source directory
6769
68-
file: ZIP file containing the application
70+
entrypoint_rel_path: Relative path to the entrypoint of the application
6971
70-
version: Version of the application
72+
force: Allow overwriting an existing app version
7173
72-
region: AWS region for deployment (e.g. "aws.us-east-1a")
74+
region: Region for deployment. Currently we only support "aws.us-east-1a"
75+
76+
version: Version of the application. Can be any string.
7377
7478
extra_headers: Send extra headers
7579
@@ -81,10 +85,11 @@ def deploy(
8185
"""
8286
body = deepcopy_minimal(
8387
{
84-
"app_name": app_name,
8588
"file": file,
86-
"version": version,
89+
"entrypoint_rel_path": entrypoint_rel_path,
90+
"force": force,
8791
"region": region,
92+
"version": version,
8893
}
8994
)
9095
files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
@@ -210,10 +215,11 @@ def with_streaming_response(self) -> AsyncAppsResourceWithStreamingResponse:
210215
async def deploy(
211216
self,
212217
*,
213-
app_name: str,
214218
file: FileTypes,
215-
version: str,
216-
region: str | NotGiven = NOT_GIVEN,
219+
entrypoint_rel_path: str | NotGiven = NOT_GIVEN,
220+
force: Literal["true", "false"] | NotGiven = NOT_GIVEN,
221+
region: Literal["aws.us-east-1a"] | NotGiven = NOT_GIVEN,
222+
version: str | NotGiven = NOT_GIVEN,
217223
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
218224
# The extra values given here take precedence over values defined on the client or passed to this method.
219225
extra_headers: Headers | None = None,
@@ -225,13 +231,15 @@ async def deploy(
225231
Deploy a new application
226232
227233
Args:
228-
app_name: Name of the application
234+
file: ZIP file containing the application source directory
229235
230-
file: ZIP file containing the application
236+
entrypoint_rel_path: Relative path to the entrypoint of the application
231237
232-
version: Version of the application
238+
force: Allow overwriting an existing app version
233239
234-
region: AWS region for deployment (e.g. "aws.us-east-1a")
240+
region: Region for deployment. Currently we only support "aws.us-east-1a"
241+
242+
version: Version of the application. Can be any string.
235243
236244
extra_headers: Send extra headers
237245
@@ -243,10 +251,11 @@ async def deploy(
243251
"""
244252
body = deepcopy_minimal(
245253
{
246-
"app_name": app_name,
247254
"file": file,
248-
"version": version,
255+
"entrypoint_rel_path": entrypoint_rel_path,
256+
"force": force,
249257
"region": region,
258+
"version": version,
250259
}
251260
)
252261
files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])

src/kernel/resources/browser.py

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

55
import httpx
66

7+
from ..types import browser_create_session_params
78
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
9+
from .._utils import maybe_transform, async_maybe_transform
810
from .._compat import cached_property
911
from .._resource import SyncAPIResource, AsyncAPIResource
1012
from .._response import (
@@ -42,16 +44,33 @@ def with_streaming_response(self) -> BrowserResourceWithStreamingResponse:
4244
def create_session(
4345
self,
4446
*,
47+
invocation_id: str,
4548
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
4649
# The extra values given here take precedence over values defined on the client or passed to this method.
4750
extra_headers: Headers | None = None,
4851
extra_query: Query | None = None,
4952
extra_body: Body | None = None,
5053
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
5154
) -> BrowserCreateSessionResponse:
52-
"""Create Browser Session"""
55+
"""
56+
Create Browser Session
57+
58+
Args:
59+
invocation_id: Kernel App invocation ID
60+
61+
extra_headers: Send extra headers
62+
63+
extra_query: Add additional query parameters to the request
64+
65+
extra_body: Add additional JSON properties to the request
66+
67+
timeout: Override the client-level default timeout for this request, in seconds
68+
"""
5369
return self._post(
5470
"/browser",
71+
body=maybe_transform(
72+
{"invocation_id": invocation_id}, browser_create_session_params.BrowserCreateSessionParams
73+
),
5574
options=make_request_options(
5675
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
5776
),
@@ -82,16 +101,33 @@ def with_streaming_response(self) -> AsyncBrowserResourceWithStreamingResponse:
82101
async def create_session(
83102
self,
84103
*,
104+
invocation_id: str,
85105
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
86106
# The extra values given here take precedence over values defined on the client or passed to this method.
87107
extra_headers: Headers | None = None,
88108
extra_query: Query | None = None,
89109
extra_body: Body | None = None,
90110
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
91111
) -> BrowserCreateSessionResponse:
92-
"""Create Browser Session"""
112+
"""
113+
Create Browser Session
114+
115+
Args:
116+
invocation_id: Kernel App invocation ID
117+
118+
extra_headers: Send extra headers
119+
120+
extra_query: Add additional query parameters to the request
121+
122+
extra_body: Add additional JSON properties to the request
123+
124+
timeout: Override the client-level default timeout for this request, in seconds
125+
"""
93126
return await self._post(
94127
"/browser",
128+
body=await async_maybe_transform(
129+
{"invocation_id": invocation_id}, browser_create_session_params.BrowserCreateSessionParams
130+
),
95131
options=make_request_options(
96132
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
97133
),

src/kernel/types/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@
66
from .app_invoke_params import AppInvokeParams as AppInvokeParams
77
from .app_deploy_response import AppDeployResponse as AppDeployResponse
88
from .app_invoke_response import AppInvokeResponse as AppInvokeResponse
9+
from .browser_create_session_params import BrowserCreateSessionParams as BrowserCreateSessionParams
910
from .browser_create_session_response import BrowserCreateSessionResponse as BrowserCreateSessionResponse
1011
from .app_retrieve_invocation_response import AppRetrieveInvocationResponse as AppRetrieveInvocationResponse

0 commit comments

Comments
 (0)