Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.0-alpha.11"
".": "0.1.0-alpha.12"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 5
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-1fe396b957ced73281fc0a61a69b630836aa5c89a8dccce2c5a1716bc9775e80.yml
openapi_spec_hash: 9a0d67fb0781be034b77839584109638
config_hash: df889df131f7438197abd59faace3c77
configured_endpoints: 7
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-c9d64df733f286f09d2203f4e3d820ce57e8d4c629c5e2db4e2bfac91fbc1598.yml
openapi_spec_hash: fa407611fc566d55f403864fbfaa6c23
config_hash: 7f67c5b95af1e4b39525515240b72275
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 0.1.0-alpha.12 (2025-05-19)

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

### Features

* **api:** update via SDK Studio ([7ae75cc](https://github.com/onkernel/kernel-python-sdk/commit/7ae75cc86e63a349ba4cd0d3e7a5e9814865766e))
* **api:** update via SDK Studio ([6359d12](https://github.com/onkernel/kernel-python-sdk/commit/6359d1225c4859929868fd58b67bbe00146951de))

## 0.1.0-alpha.11 (2025-05-19)

Full Changelog: [v0.1.0-alpha.10...v0.1.0-alpha.11](https://github.com/onkernel/kernel-python-sdk/compare/v0.1.0-alpha.10...v0.1.0-alpha.11)
Expand Down
13 changes: 12 additions & 1 deletion api.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
# Apps

Types:

```python
from kernel.types import AppListResponse
```

Methods:

- <code title="get /apps">client.apps.<a href="./src/kernel/resources/apps/apps.py">list</a>(\*\*<a href="src/kernel/types/app_list_params.py">params</a>) -> <a href="./src/kernel/types/app_list_response.py">AppListResponse</a></code>

## Deployments

Types:

```python
from kernel.types.apps import DeploymentCreateResponse
from kernel.types.apps import DeploymentCreateResponse, DeploymentFollowResponse
```

Methods:

- <code title="post /deploy">client.apps.deployments.<a href="./src/kernel/resources/apps/deployments.py">create</a>(\*\*<a href="src/kernel/types/apps/deployment_create_params.py">params</a>) -> <a href="./src/kernel/types/apps/deployment_create_response.py">DeploymentCreateResponse</a></code>
- <code title="get /apps/{id}/events">client.apps.deployments.<a href="./src/kernel/resources/apps/deployments.py">follow</a>(id) -> <a href="./src/kernel/types/apps/deployment_follow_response.py">DeploymentFollowResponse</a></code>

## Invocations

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "kernel"
version = "0.1.0-alpha.11"
version = "0.1.0-alpha.12"
description = "The official Python library for the kernel API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/kernel/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "kernel"
__version__ = "0.1.0-alpha.11" # x-release-please-version
__version__ = "0.1.0-alpha.12" # x-release-please-version
125 changes: 125 additions & 0 deletions src/kernel/resources/apps/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,19 @@

from __future__ import annotations

import httpx

from ...types import app_list_params
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._utils import maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
to_raw_response_wrapper,
to_streamed_response_wrapper,
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
from .deployments import (
DeploymentsResource,
AsyncDeploymentsResource,
Expand All @@ -20,6 +31,8 @@
InvocationsResourceWithStreamingResponse,
AsyncInvocationsResourceWithStreamingResponse,
)
from ..._base_client import make_request_options
from ...types.app_list_response import AppListResponse

__all__ = ["AppsResource", "AsyncAppsResource"]

Expand Down Expand Up @@ -52,6 +65,54 @@ def with_streaming_response(self) -> AppsResourceWithStreamingResponse:
"""
return AppsResourceWithStreamingResponse(self)

def list(
self,
*,
app_name: str | NotGiven = NOT_GIVEN,
version: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AppListResponse:
"""List application versions for the authenticated user.

Optionally filter by app
name and/or version label.

Args:
app_name: Filter results by application name.

version: Filter results by version label.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
return self._get(
"/apps",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=maybe_transform(
{
"app_name": app_name,
"version": version,
},
app_list_params.AppListParams,
),
),
cast_to=AppListResponse,
)


class AsyncAppsResource(AsyncAPIResource):
@cached_property
Expand Down Expand Up @@ -81,11 +142,63 @@ def with_streaming_response(self) -> AsyncAppsResourceWithStreamingResponse:
"""
return AsyncAppsResourceWithStreamingResponse(self)

async def list(
self,
*,
app_name: str | NotGiven = NOT_GIVEN,
version: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AppListResponse:
"""List application versions for the authenticated user.

Optionally filter by app
name and/or version label.

Args:
app_name: Filter results by application name.

version: Filter results by version label.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
return await self._get(
"/apps",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=await async_maybe_transform(
{
"app_name": app_name,
"version": version,
},
app_list_params.AppListParams,
),
),
cast_to=AppListResponse,
)


class AppsResourceWithRawResponse:
def __init__(self, apps: AppsResource) -> None:
self._apps = apps

self.list = to_raw_response_wrapper(
apps.list,
)

@cached_property
def deployments(self) -> DeploymentsResourceWithRawResponse:
return DeploymentsResourceWithRawResponse(self._apps.deployments)
Expand All @@ -99,6 +212,10 @@ class AsyncAppsResourceWithRawResponse:
def __init__(self, apps: AsyncAppsResource) -> None:
self._apps = apps

self.list = async_to_raw_response_wrapper(
apps.list,
)

@cached_property
def deployments(self) -> AsyncDeploymentsResourceWithRawResponse:
return AsyncDeploymentsResourceWithRawResponse(self._apps.deployments)
Expand All @@ -112,6 +229,10 @@ class AppsResourceWithStreamingResponse:
def __init__(self, apps: AppsResource) -> None:
self._apps = apps

self.list = to_streamed_response_wrapper(
apps.list,
)

@cached_property
def deployments(self) -> DeploymentsResourceWithStreamingResponse:
return DeploymentsResourceWithStreamingResponse(self._apps.deployments)
Expand All @@ -125,6 +246,10 @@ class AsyncAppsResourceWithStreamingResponse:
def __init__(self, apps: AsyncAppsResource) -> None:
self._apps = apps

self.list = async_to_streamed_response_wrapper(
apps.list,
)

@cached_property
def deployments(self) -> AsyncDeploymentsResourceWithStreamingResponse:
return AsyncDeploymentsResourceWithStreamingResponse(self._apps.deployments)
Expand Down
90 changes: 90 additions & 0 deletions src/kernel/resources/apps/deployments.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
from ..._streaming import Stream, AsyncStream
from ...types.apps import deployment_create_params
from ..._base_client import make_request_options
from ...types.apps.deployment_create_response import DeploymentCreateResponse
from ...types.apps.deployment_follow_response import DeploymentFollowResponse

__all__ = ["DeploymentsResource", "AsyncDeploymentsResource"]

Expand Down Expand Up @@ -110,6 +112,44 @@ def create(
cast_to=DeploymentCreateResponse,
)

def follow(
self,
id: str,
*,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Stream[DeploymentFollowResponse]:
"""
Establishes a Server-Sent Events (SSE) stream that delivers real-time logs and
status updates for a deployed application. The stream terminates automatically
once the application reaches a terminal state.

Args:
extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
extra_headers = {"Accept": "text/event-stream", **(extra_headers or {})}
return self._get(
f"/apps/{id}/events",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=DeploymentFollowResponse,
stream=True,
stream_cls=Stream[DeploymentFollowResponse],
)


class AsyncDeploymentsResource(AsyncAPIResource):
@cached_property
Expand Down Expand Up @@ -197,6 +237,44 @@ async def create(
cast_to=DeploymentCreateResponse,
)

async def follow(
self,
id: str,
*,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AsyncStream[DeploymentFollowResponse]:
"""
Establishes a Server-Sent Events (SSE) stream that delivers real-time logs and
status updates for a deployed application. The stream terminates automatically
once the application reaches a terminal state.

Args:
extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
extra_headers = {"Accept": "text/event-stream", **(extra_headers or {})}
return await self._get(
f"/apps/{id}/events",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=DeploymentFollowResponse,
stream=True,
stream_cls=AsyncStream[DeploymentFollowResponse],
)


class DeploymentsResourceWithRawResponse:
def __init__(self, deployments: DeploymentsResource) -> None:
Expand All @@ -205,6 +283,9 @@ def __init__(self, deployments: DeploymentsResource) -> None:
self.create = to_raw_response_wrapper(
deployments.create,
)
self.follow = to_raw_response_wrapper(
deployments.follow,
)


class AsyncDeploymentsResourceWithRawResponse:
Expand All @@ -214,6 +295,9 @@ def __init__(self, deployments: AsyncDeploymentsResource) -> None:
self.create = async_to_raw_response_wrapper(
deployments.create,
)
self.follow = async_to_raw_response_wrapper(
deployments.follow,
)


class DeploymentsResourceWithStreamingResponse:
Expand All @@ -223,6 +307,9 @@ def __init__(self, deployments: DeploymentsResource) -> None:
self.create = to_streamed_response_wrapper(
deployments.create,
)
self.follow = to_streamed_response_wrapper(
deployments.follow,
)


class AsyncDeploymentsResourceWithStreamingResponse:
Expand All @@ -232,3 +319,6 @@ def __init__(self, deployments: AsyncDeploymentsResource) -> None:
self.create = async_to_streamed_response_wrapper(
deployments.create,
)
self.follow = async_to_streamed_response_wrapper(
deployments.follow,
)
Loading