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.11.1"
".": "0.11.2"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 46
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-cb38560915edce03abce2ae3ef5bc745489dbe9b6f80c2b4ff42edf8c2ff276d.yml
openapi_spec_hash: a869194d6c864ba28d79ec0105439c3e
config_hash: ed56f95781ec9b2e73c97e1a66606071
configured_endpoints: 50
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-d3a597bbbb25c131e2c06eb9b47d70932d14a97a6f916677a195a128e196f4db.yml
openapi_spec_hash: c967b384624017eed0abff1b53a74530
config_hash: 0d150b61cae2dc57d3648ceae7784966
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## 0.11.2 (2025-09-24)

Full Changelog: [v0.11.1...v0.11.2](https://github.com/onkernel/kernel-python-sdk/compare/v0.11.1...v0.11.2)

### Features

* Add stainless CI ([9c8ccbf](https://github.com/onkernel/kernel-python-sdk/commit/9c8ccbfb59c6e7f9c5b649193ab10580d1d750e9))


### Chores

* do not install brew dependencies in ./scripts/bootstrap by default ([e7e72e6](https://github.com/onkernel/kernel-python-sdk/commit/e7e72e6642f7587af34f51608d3bde4112d1e711))
* improve example values ([2ecd936](https://github.com/onkernel/kernel-python-sdk/commit/2ecd936567bb98eda0edab68fb970668548bbc00))
* **internal:** update pydantic dependency ([45de860](https://github.com/onkernel/kernel-python-sdk/commit/45de860fb92aeeccf5ef44dcb2b5ab4a2b7a0592))
* **types:** change optional parameter type from NotGiven to Omit ([0b85104](https://github.com/onkernel/kernel-python-sdk/commit/0b85104d500907e1f86ad633403fb4c27fb929c4))

## 0.11.1 (2025-09-06)

Full Changelog: [v0.11.0...v0.11.1](https://github.com/onkernel/kernel-python-sdk/compare/v0.11.0...v0.11.1)
Expand Down
15 changes: 15 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,18 @@ Methods:
- <code title="get /profiles">client.profiles.<a href="./src/kernel/resources/profiles.py">list</a>() -> <a href="./src/kernel/types/profile_list_response.py">ProfileListResponse</a></code>
- <code title="delete /profiles/{id_or_name}">client.profiles.<a href="./src/kernel/resources/profiles.py">delete</a>(id_or_name) -> None</code>
- <code title="get /profiles/{id_or_name}/download">client.profiles.<a href="./src/kernel/resources/profiles.py">download</a>(id_or_name) -> BinaryAPIResponse</code>

# Proxies

Types:

```python
from kernel.types import ProxyCreateResponse, ProxyRetrieveResponse, ProxyListResponse
```

Methods:

- <code title="post /proxies">client.proxies.<a href="./src/kernel/resources/proxies.py">create</a>(\*\*<a href="src/kernel/types/proxy_create_params.py">params</a>) -> <a href="./src/kernel/types/proxy_create_response.py">ProxyCreateResponse</a></code>
- <code title="get /proxies/{id}">client.proxies.<a href="./src/kernel/resources/proxies.py">retrieve</a>(id) -> <a href="./src/kernel/types/proxy_retrieve_response.py">ProxyRetrieveResponse</a></code>
- <code title="get /proxies">client.proxies.<a href="./src/kernel/resources/proxies.py">list</a>() -> <a href="./src/kernel/types/proxy_list_response.py">ProxyListResponse</a></code>
- <code title="delete /proxies/{id}">client.proxies.<a href="./src/kernel/resources/proxies.py">delete</a>(id) -> None</code>
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.11.1"
version = "0.11.2"
description = "The official Python library for the kernel API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
7 changes: 5 additions & 2 deletions requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ pluggy==1.5.0
propcache==0.3.1
# via aiohttp
# via yarl
pydantic==2.10.3
pydantic==2.11.9
# via kernel
pydantic-core==2.27.1
pydantic-core==2.33.2
# via pydantic
pygments==2.18.0
# via rich
Expand Down Expand Up @@ -126,6 +126,9 @@ typing-extensions==4.12.2
# via pydantic
# via pydantic-core
# via pyright
# via typing-inspection
typing-inspection==0.4.1
# via pydantic
virtualenv==20.24.5
# via nox
yarl==1.20.0
Expand Down
7 changes: 5 additions & 2 deletions requirements.lock
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ multidict==6.4.4
propcache==0.3.1
# via aiohttp
# via yarl
pydantic==2.10.3
pydantic==2.11.9
# via kernel
pydantic-core==2.27.1
pydantic-core==2.33.2
# via pydantic
sniffio==1.3.0
# via anyio
Expand All @@ -68,5 +68,8 @@ typing-extensions==4.12.2
# via multidict
# via pydantic
# via pydantic-core
# via typing-inspection
typing-inspection==0.4.1
# via pydantic
yarl==1.20.0
# via aiohttp
14 changes: 11 additions & 3 deletions scripts/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@ set -e

cd "$(dirname "$0")/.."

if ! command -v rye >/dev/null 2>&1 && [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then
if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ] && [ -t 0 ]; then
brew bundle check >/dev/null 2>&1 || {
echo "==> Installing Homebrew dependencies…"
brew bundle
echo -n "==> Install Homebrew dependencies? (y/N): "
read -r response
case "$response" in
[yY][eE][sS]|[yY])
brew bundle
;;
*)
;;
esac
echo
}
fi

Expand Down
4 changes: 3 additions & 1 deletion src/kernel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import typing as _t

from . import types
from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes
from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes, omit, not_given
from ._utils import file_from_path
from ._client import (
ENVIRONMENTS,
Expand Down Expand Up @@ -61,7 +61,9 @@
"ProxiesTypes",
"NotGiven",
"NOT_GIVEN",
"not_given",
"Omit",
"omit",
"KernelError",
"APIError",
"APIStatusError",
Expand Down
18 changes: 9 additions & 9 deletions src/kernel/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
from ._qs import Querystring
from ._files import to_httpx_files, async_to_httpx_files
from ._types import (
NOT_GIVEN,
Body,
Omit,
Query,
Expand All @@ -57,6 +56,7 @@
RequestOptions,
HttpxRequestFiles,
ModelBuilderProtocol,
not_given,
)
from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping
from ._compat import PYDANTIC_V1, model_copy, model_dump
Expand Down Expand Up @@ -145,9 +145,9 @@ def __init__(
def __init__(
self,
*,
url: URL | NotGiven = NOT_GIVEN,
json: Body | NotGiven = NOT_GIVEN,
params: Query | NotGiven = NOT_GIVEN,
url: URL | NotGiven = not_given,
json: Body | NotGiven = not_given,
params: Query | NotGiven = not_given,
) -> None:
self.url = url
self.json = json
Expand Down Expand Up @@ -595,7 +595,7 @@ def _maybe_override_cast_to(self, cast_to: type[ResponseT], options: FinalReques
# we internally support defining a temporary header to override the
# default `cast_to` type for use with `.with_raw_response` and `.with_streaming_response`
# see _response.py for implementation details
override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER, NOT_GIVEN)
override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER, not_given)
if is_given(override_cast_to):
options.headers = headers
return cast(Type[ResponseT], override_cast_to)
Expand Down Expand Up @@ -825,7 +825,7 @@ def __init__(
version: str,
base_url: str | URL,
max_retries: int = DEFAULT_MAX_RETRIES,
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | Timeout | None | NotGiven = not_given,
http_client: httpx.Client | None = None,
custom_headers: Mapping[str, str] | None = None,
custom_query: Mapping[str, object] | None = None,
Expand Down Expand Up @@ -1356,7 +1356,7 @@ def __init__(
base_url: str | URL,
_strict_response_validation: bool,
max_retries: int = DEFAULT_MAX_RETRIES,
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | Timeout | None | NotGiven = not_given,
http_client: httpx.AsyncClient | None = None,
custom_headers: Mapping[str, str] | None = None,
custom_query: Mapping[str, object] | None = None,
Expand Down Expand Up @@ -1818,8 +1818,8 @@ def make_request_options(
extra_query: Query | None = None,
extra_body: Body | None = None,
idempotency_key: str | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
post_parser: PostParser | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
post_parser: PostParser | NotGiven = not_given,
) -> RequestOptions:
"""Create a dict of type RequestOptions without keys of NotGiven values."""
options: RequestOptions = {}
Expand Down
34 changes: 21 additions & 13 deletions src/kernel/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@
from __future__ import annotations

import os
from typing import Any, Dict, Union, Mapping, cast
from typing import Any, Dict, Mapping, cast
from typing_extensions import Self, Literal, override

import httpx

from . import _exceptions
from ._qs import Querystring
from ._types import (
NOT_GIVEN,
Omit,
Timeout,
NotGiven,
Transport,
ProxiesTypes,
RequestOptions,
not_given,
)
from ._utils import is_given, get_async_library
from ._version import __version__
from .resources import apps, profiles, deployments, invocations
from .resources import apps, proxies, profiles, deployments, invocations
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
from ._exceptions import KernelError, APIStatusError
from ._base_client import (
Expand Down Expand Up @@ -55,6 +55,7 @@ class Kernel(SyncAPIClient):
invocations: invocations.InvocationsResource
browsers: browsers.BrowsersResource
profiles: profiles.ProfilesResource
proxies: proxies.ProxiesResource
with_raw_response: KernelWithRawResponse
with_streaming_response: KernelWithStreamedResponse

Expand All @@ -67,9 +68,9 @@ def __init__(
self,
*,
api_key: str | None = None,
environment: Literal["production", "development"] | NotGiven = NOT_GIVEN,
base_url: str | httpx.URL | None | NotGiven = NOT_GIVEN,
timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN,
environment: Literal["production", "development"] | NotGiven = not_given,
base_url: str | httpx.URL | None | NotGiven = not_given,
timeout: float | Timeout | None | NotGiven = not_given,
max_retries: int = DEFAULT_MAX_RETRIES,
default_headers: Mapping[str, str] | None = None,
default_query: Mapping[str, object] | None = None,
Expand Down Expand Up @@ -141,6 +142,7 @@ def __init__(
self.invocations = invocations.InvocationsResource(self)
self.browsers = browsers.BrowsersResource(self)
self.profiles = profiles.ProfilesResource(self)
self.proxies = proxies.ProxiesResource(self)
self.with_raw_response = KernelWithRawResponse(self)
self.with_streaming_response = KernelWithStreamedResponse(self)

Expand Down Expand Up @@ -170,9 +172,9 @@ def copy(
api_key: str | None = None,
environment: Literal["production", "development"] | None = None,
base_url: str | httpx.URL | None = None,
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | Timeout | None | NotGiven = not_given,
http_client: httpx.Client | None = None,
max_retries: int | NotGiven = NOT_GIVEN,
max_retries: int | NotGiven = not_given,
default_headers: Mapping[str, str] | None = None,
set_default_headers: Mapping[str, str] | None = None,
default_query: Mapping[str, object] | None = None,
Expand Down Expand Up @@ -257,6 +259,7 @@ class AsyncKernel(AsyncAPIClient):
invocations: invocations.AsyncInvocationsResource
browsers: browsers.AsyncBrowsersResource
profiles: profiles.AsyncProfilesResource
proxies: proxies.AsyncProxiesResource
with_raw_response: AsyncKernelWithRawResponse
with_streaming_response: AsyncKernelWithStreamedResponse

Expand All @@ -269,9 +272,9 @@ def __init__(
self,
*,
api_key: str | None = None,
environment: Literal["production", "development"] | NotGiven = NOT_GIVEN,
base_url: str | httpx.URL | None | NotGiven = NOT_GIVEN,
timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN,
environment: Literal["production", "development"] | NotGiven = not_given,
base_url: str | httpx.URL | None | NotGiven = not_given,
timeout: float | Timeout | None | NotGiven = not_given,
max_retries: int = DEFAULT_MAX_RETRIES,
default_headers: Mapping[str, str] | None = None,
default_query: Mapping[str, object] | None = None,
Expand Down Expand Up @@ -343,6 +346,7 @@ def __init__(
self.invocations = invocations.AsyncInvocationsResource(self)
self.browsers = browsers.AsyncBrowsersResource(self)
self.profiles = profiles.AsyncProfilesResource(self)
self.proxies = proxies.AsyncProxiesResource(self)
self.with_raw_response = AsyncKernelWithRawResponse(self)
self.with_streaming_response = AsyncKernelWithStreamedResponse(self)

Expand Down Expand Up @@ -372,9 +376,9 @@ def copy(
api_key: str | None = None,
environment: Literal["production", "development"] | None = None,
base_url: str | httpx.URL | None = None,
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | Timeout | None | NotGiven = not_given,
http_client: httpx.AsyncClient | None = None,
max_retries: int | NotGiven = NOT_GIVEN,
max_retries: int | NotGiven = not_given,
default_headers: Mapping[str, str] | None = None,
set_default_headers: Mapping[str, str] | None = None,
default_query: Mapping[str, object] | None = None,
Expand Down Expand Up @@ -460,6 +464,7 @@ def __init__(self, client: Kernel) -> None:
self.invocations = invocations.InvocationsResourceWithRawResponse(client.invocations)
self.browsers = browsers.BrowsersResourceWithRawResponse(client.browsers)
self.profiles = profiles.ProfilesResourceWithRawResponse(client.profiles)
self.proxies = proxies.ProxiesResourceWithRawResponse(client.proxies)


class AsyncKernelWithRawResponse:
Expand All @@ -469,6 +474,7 @@ def __init__(self, client: AsyncKernel) -> None:
self.invocations = invocations.AsyncInvocationsResourceWithRawResponse(client.invocations)
self.browsers = browsers.AsyncBrowsersResourceWithRawResponse(client.browsers)
self.profiles = profiles.AsyncProfilesResourceWithRawResponse(client.profiles)
self.proxies = proxies.AsyncProxiesResourceWithRawResponse(client.proxies)


class KernelWithStreamedResponse:
Expand All @@ -478,6 +484,7 @@ def __init__(self, client: Kernel) -> None:
self.invocations = invocations.InvocationsResourceWithStreamingResponse(client.invocations)
self.browsers = browsers.BrowsersResourceWithStreamingResponse(client.browsers)
self.profiles = profiles.ProfilesResourceWithStreamingResponse(client.profiles)
self.proxies = proxies.ProxiesResourceWithStreamingResponse(client.proxies)


class AsyncKernelWithStreamedResponse:
Expand All @@ -487,6 +494,7 @@ def __init__(self, client: AsyncKernel) -> None:
self.invocations = invocations.AsyncInvocationsResourceWithStreamingResponse(client.invocations)
self.browsers = browsers.AsyncBrowsersResourceWithStreamingResponse(client.browsers)
self.profiles = profiles.AsyncProfilesResourceWithStreamingResponse(client.profiles)
self.proxies = proxies.AsyncProxiesResourceWithStreamingResponse(client.proxies)


Client = Kernel
Expand Down
Loading