diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 86b0e83..cb9d254 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.21.0" + ".": "0.22.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 25e77f1..7792bb0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 74 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-3db06d1628149b5ea8303f1c72250664dfd7cb4a14ceb6102f1ae6e85c92c038.yml -openapi_spec_hash: e5b3da2da328eb26d2a70e2521744c62 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-003e9afa15f0765009d2c7d34e8eb62268d818e628e3c84361b21138e30cc423.yml +openapi_spec_hash: c1b8309f60385bf2b02d245363ca47c1 config_hash: a4124701ae0a474e580d7416adbcfb00 diff --git a/CHANGELOG.md b/CHANGELOG.md index a726401..b9f3aa1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## 0.22.0 (2025-12-05) + +Full Changelog: [v0.21.0...v0.22.0](https://github.com/onkernel/kernel-python-sdk/compare/v0.21.0...v0.22.0) + +### Features + +* Add `async_timeout_seconds` to PostInvocations ([2866021](https://github.com/onkernel/kernel-python-sdk/commit/286602193261f0d1beaad24dd633c3a1b0838654)) + + +### Chores + +* **docs:** use environment variables for authentication in code snippets ([eec0be5](https://github.com/onkernel/kernel-python-sdk/commit/eec0be59552f9057179b9597fc336fddd544d4b1)) +* update lockfile ([ecee109](https://github.com/onkernel/kernel-python-sdk/commit/ecee109b4d10a786394c9807f82007849b7294d8)) + ## 0.21.0 (2025-12-02) Full Changelog: [v0.20.0...v0.21.0](https://github.com/onkernel/kernel-python-sdk/compare/v0.20.0...v0.21.0) diff --git a/README.md b/README.md index 699f3c2..d5905ea 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,7 @@ pip install kernel[aiohttp] Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`: ```python +import os import asyncio from kernel import DefaultAioHttpClient from kernel import AsyncKernel @@ -94,7 +95,7 @@ from kernel import AsyncKernel async def main() -> None: async with AsyncKernel( - api_key="My API Key", + api_key=os.environ.get("KERNEL_API_KEY"), # This is the default and can be omitted http_client=DefaultAioHttpClient(), ) as client: browser = await client.browsers.create( diff --git a/pyproject.toml b/pyproject.toml index f4bbe65..facf999 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,20 +1,22 @@ [project] name = "kernel" -version = "0.21.0" +version = "0.22.0" description = "The official Python library for the kernel API" dynamic = ["readme"] license = "Apache-2.0" authors = [ { name = "Kernel", email = "" }, ] + dependencies = [ - "httpx>=0.23.0, <1", - "pydantic>=1.9.0, <3", - "typing-extensions>=4.10, <5", - "anyio>=3.5.0, <5", - "distro>=1.7.0, <2", - "sniffio", + "httpx>=0.23.0, <1", + "pydantic>=1.9.0, <3", + "typing-extensions>=4.10, <5", + "anyio>=3.5.0, <5", + "distro>=1.7.0, <2", + "sniffio", ] + requires-python = ">= 3.9" classifiers = [ "Typing :: Typed", diff --git a/requirements-dev.lock b/requirements-dev.lock index b435fc7..7643dfb 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -12,40 +12,45 @@ -e file:. aiohappyeyeballs==2.6.1 # via aiohttp -aiohttp==3.12.8 +aiohttp==3.13.2 # via httpx-aiohttp # via kernel -aiosignal==1.3.2 +aiosignal==1.4.0 # via aiohttp -annotated-types==0.6.0 +annotated-types==0.7.0 # via pydantic -anyio==4.4.0 +anyio==4.12.0 # via httpx # via kernel -argcomplete==3.1.2 +argcomplete==3.6.3 # via nox async-timeout==5.0.1 # via aiohttp -attrs==25.3.0 +attrs==25.4.0 # via aiohttp -certifi==2023.7.22 + # via nox +backports-asyncio-runner==1.2.0 + # via pytest-asyncio +certifi==2025.11.12 # via httpcore # via httpx -colorlog==6.7.0 +colorlog==6.10.1 + # via nox +dependency-groups==1.3.1 # via nox -dirty-equals==0.6.0 -distlib==0.3.7 +dirty-equals==0.11 +distlib==0.4.0 # via virtualenv -distro==1.8.0 +distro==1.9.0 # via kernel -exceptiongroup==1.2.2 +exceptiongroup==1.3.1 # via anyio # via pytest -execnet==2.1.1 +execnet==2.1.2 # via pytest-xdist -filelock==3.12.4 +filelock==3.19.1 # via virtualenv -frozenlist==1.6.2 +frozenlist==1.8.0 # via aiohttp # via aiosignal h11==0.16.0 @@ -58,82 +63,87 @@ httpx==0.28.1 # via respx httpx-aiohttp==0.1.9 # via kernel -idna==3.4 +humanize==4.13.0 + # via nox +idna==3.11 # via anyio # via httpx # via yarl -importlib-metadata==7.0.0 -iniconfig==2.0.0 +importlib-metadata==8.7.0 +iniconfig==2.1.0 # via pytest markdown-it-py==3.0.0 # via rich mdurl==0.1.2 # via markdown-it-py -multidict==6.4.4 +multidict==6.7.0 # via aiohttp # via yarl mypy==1.17.0 -mypy-extensions==1.0.0 +mypy-extensions==1.1.0 # via mypy -nodeenv==1.8.0 +nodeenv==1.9.1 # via pyright -nox==2023.4.22 -packaging==23.2 +nox==2025.11.12 +packaging==25.0 + # via dependency-groups # via nox # via pytest pathspec==0.12.1 # via mypy -platformdirs==3.11.0 +platformdirs==4.4.0 # via virtualenv -pluggy==1.5.0 +pluggy==1.6.0 # via pytest -propcache==0.3.1 +propcache==0.4.1 # via aiohttp # via yarl -pydantic==2.11.9 +pydantic==2.12.5 # via kernel -pydantic-core==2.33.2 +pydantic-core==2.41.5 # via pydantic -pygments==2.18.0 +pygments==2.19.2 + # via pytest # via rich pyright==1.1.399 -pytest==8.3.3 +pytest==8.4.2 # via pytest-asyncio # via pytest-xdist -pytest-asyncio==0.24.0 -pytest-xdist==3.7.0 -python-dateutil==2.8.2 +pytest-asyncio==1.2.0 +pytest-xdist==3.8.0 +python-dateutil==2.9.0.post0 # via time-machine -pytz==2023.3.post1 - # via dirty-equals respx==0.22.0 -rich==13.7.1 -ruff==0.9.4 -setuptools==68.2.2 - # via nodeenv -six==1.16.0 +rich==14.2.0 +ruff==0.14.7 +six==1.17.0 # via python-dateutil -sniffio==1.3.0 - # via anyio +sniffio==1.3.1 # via kernel -time-machine==2.9.0 -tomli==2.0.2 +time-machine==2.19.0 +tomli==2.3.0 + # via dependency-groups # via mypy + # via nox # via pytest -typing-extensions==4.12.2 +typing-extensions==4.15.0 + # via aiosignal # via anyio + # via exceptiongroup # via kernel # via multidict # via mypy # via pydantic # via pydantic-core # via pyright + # via pytest-asyncio # via typing-inspection -typing-inspection==0.4.1 + # via virtualenv +typing-inspection==0.4.2 # via pydantic -virtualenv==20.24.5 +virtualenv==20.35.4 # via nox -yarl==1.20.0 +yarl==1.22.0 # via aiohttp -zipp==3.17.0 +zipp==3.23.0 # via importlib-metadata diff --git a/requirements.lock b/requirements.lock index 646e8cd..bbfe2b3 100644 --- a/requirements.lock +++ b/requirements.lock @@ -12,28 +12,28 @@ -e file:. aiohappyeyeballs==2.6.1 # via aiohttp -aiohttp==3.12.8 +aiohttp==3.13.2 # via httpx-aiohttp # via kernel -aiosignal==1.3.2 +aiosignal==1.4.0 # via aiohttp -annotated-types==0.6.0 +annotated-types==0.7.0 # via pydantic -anyio==4.4.0 +anyio==4.12.0 # via httpx # via kernel async-timeout==5.0.1 # via aiohttp -attrs==25.3.0 +attrs==25.4.0 # via aiohttp -certifi==2023.7.22 +certifi==2025.11.12 # via httpcore # via httpx -distro==1.8.0 +distro==1.9.0 # via kernel -exceptiongroup==1.2.2 +exceptiongroup==1.3.1 # via anyio -frozenlist==1.6.2 +frozenlist==1.8.0 # via aiohttp # via aiosignal h11==0.16.0 @@ -45,25 +45,26 @@ httpx==0.28.1 # via kernel httpx-aiohttp==0.1.9 # via kernel -idna==3.4 +idna==3.11 # via anyio # via httpx # via yarl -multidict==6.4.4 +multidict==6.7.0 # via aiohttp # via yarl -propcache==0.3.1 +propcache==0.4.1 # via aiohttp # via yarl pydantic==2.12.5 # via kernel pydantic-core==2.41.5 # via pydantic -sniffio==1.3.0 - # via anyio +sniffio==1.3.1 # via kernel typing-extensions==4.15.0 + # via aiosignal # via anyio + # via exceptiongroup # via kernel # via multidict # via pydantic @@ -71,5 +72,5 @@ typing-extensions==4.15.0 # via typing-inspection typing-inspection==0.4.2 # via pydantic -yarl==1.20.0 +yarl==1.22.0 # via aiohttp diff --git a/src/kernel/_version.py b/src/kernel/_version.py index 1bd01d6..c911504 100644 --- a/src/kernel/_version.py +++ b/src/kernel/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "kernel" -__version__ = "0.21.0" # x-release-please-version +__version__ = "0.22.0" # x-release-please-version diff --git a/src/kernel/resources/invocations.py b/src/kernel/resources/invocations.py index 4c7e781..fa808dd 100644 --- a/src/kernel/resources/invocations.py +++ b/src/kernel/resources/invocations.py @@ -57,6 +57,7 @@ def create( app_name: str, version: str, async_: bool | Omit = omit, + async_timeout_seconds: int | Omit = omit, payload: str | Omit = omit, # 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. @@ -78,6 +79,9 @@ def create( async_: If true, invoke asynchronously. When set, the API responds 202 Accepted with status "queued". + async_timeout_seconds: Timeout in seconds for async invocations (min 10, max 3600). Only applies when + async is true. + payload: Input data for the action, sent as a JSON string. extra_headers: Send extra headers @@ -96,6 +100,7 @@ def create( "app_name": app_name, "version": version, "async_": async_, + "async_timeout_seconds": async_timeout_seconds, "payload": payload, }, invocation_create_params.InvocationCreateParams, @@ -370,6 +375,7 @@ async def create( app_name: str, version: str, async_: bool | Omit = omit, + async_timeout_seconds: int | Omit = omit, payload: str | Omit = omit, # 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. @@ -391,6 +397,9 @@ async def create( async_: If true, invoke asynchronously. When set, the API responds 202 Accepted with status "queued". + async_timeout_seconds: Timeout in seconds for async invocations (min 10, max 3600). Only applies when + async is true. + payload: Input data for the action, sent as a JSON string. extra_headers: Send extra headers @@ -409,6 +418,7 @@ async def create( "app_name": app_name, "version": version, "async_": async_, + "async_timeout_seconds": async_timeout_seconds, "payload": payload, }, invocation_create_params.InvocationCreateParams, diff --git a/src/kernel/types/invocation_create_params.py b/src/kernel/types/invocation_create_params.py index 1d6bc64..288656a 100644 --- a/src/kernel/types/invocation_create_params.py +++ b/src/kernel/types/invocation_create_params.py @@ -25,5 +25,11 @@ class InvocationCreateParams(TypedDict, total=False): When set, the API responds 202 Accepted with status "queued". """ + async_timeout_seconds: int + """Timeout in seconds for async invocations (min 10, max 3600). + + Only applies when async is true. + """ + payload: str """Input data for the action, sent as a JSON string.""" diff --git a/tests/api_resources/test_invocations.py b/tests/api_resources/test_invocations.py index d36ea25..40c0545 100644 --- a/tests/api_resources/test_invocations.py +++ b/tests/api_resources/test_invocations.py @@ -41,6 +41,7 @@ def test_method_create_with_all_params(self, client: Kernel) -> None: app_name="my-app", version="1.0.0", async_=True, + async_timeout_seconds=600, payload='{"data":"example input"}', ) assert_matches_type(InvocationCreateResponse, invocation, path=["response"]) @@ -332,6 +333,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncKernel) -> app_name="my-app", version="1.0.0", async_=True, + async_timeout_seconds=600, payload='{"data":"example input"}', ) assert_matches_type(InvocationCreateResponse, invocation, path=["response"])