From c46aa48e7d07db3317b038c51b3c58a88b2d44d4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 25 Jul 2025 03:34:16 +0000 Subject: [PATCH 1/6] chore(project): add settings file for vscode --- .gitignore | 1 - .vscode/settings.json | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 .vscode/settings.json diff --git a/.gitignore b/.gitignore index 8779740..95ceb18 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ .prism.log -.vscode _dev __pycache__ diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..5b01030 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "python.analysis.importFormat": "relative", +} From 1649d1811af28c91b22a55d42159336f0a4d49b4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 30 Jul 2025 00:52:47 +0000 Subject: [PATCH 2/6] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5c1470b..fbe1e82 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 19 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-5e4716f7fce42bbcecc7ecb699c1c467ae778d74d558f7a260d531e2af1a7f30.yml -openapi_spec_hash: f545dcef9001b00c2604e3dcc6a12f7a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-9f2d347a4bcb03aed092ba4495aac090c3d988e9a99af091ee35c09994adad8b.yml +openapi_spec_hash: 73b92bd5503ab6c64dc26da31cca36e2 config_hash: 65328ff206b8c0168c915914506d9dba From 79b06da326192ceb5edf703576bd25835cbed031 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 31 Jul 2025 04:38:53 +0000 Subject: [PATCH 3/6] feat(client): support file upload requests --- src/kernel/_base_client.py | 5 ++++- src/kernel/_files.py | 8 ++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/kernel/_base_client.py b/src/kernel/_base_client.py index a654874..79cd090 100644 --- a/src/kernel/_base_client.py +++ b/src/kernel/_base_client.py @@ -532,7 +532,10 @@ def _build_request( is_body_allowed = options.method.lower() != "get" if is_body_allowed: - kwargs["json"] = json_data if is_given(json_data) else None + if isinstance(json_data, bytes): + kwargs["content"] = json_data + else: + kwargs["json"] = json_data if is_given(json_data) else None kwargs["files"] = files else: headers.pop("Content-Type", None) diff --git a/src/kernel/_files.py b/src/kernel/_files.py index 63dab8a..9a6dd19 100644 --- a/src/kernel/_files.py +++ b/src/kernel/_files.py @@ -69,12 +69,12 @@ def _transform_file(file: FileTypes) -> HttpxFileTypes: return file if is_tuple_t(file): - return (file[0], _read_file_content(file[1]), *file[2:]) + return (file[0], read_file_content(file[1]), *file[2:]) raise TypeError(f"Expected file types input to be a FileContent type or to be a tuple") -def _read_file_content(file: FileContent) -> HttpxFileContent: +def read_file_content(file: FileContent) -> HttpxFileContent: if isinstance(file, os.PathLike): return pathlib.Path(file).read_bytes() return file @@ -111,12 +111,12 @@ async def _async_transform_file(file: FileTypes) -> HttpxFileTypes: return file if is_tuple_t(file): - return (file[0], await _async_read_file_content(file[1]), *file[2:]) + return (file[0], await async_read_file_content(file[1]), *file[2:]) raise TypeError(f"Expected file types input to be a FileContent type or to be a tuple") -async def _async_read_file_content(file: FileContent) -> HttpxFileContent: +async def async_read_file_content(file: FileContent) -> HttpxFileContent: if isinstance(file, os.PathLike): return await anyio.Path(file).read_bytes() From 6d43e73a5206d3faa99825d6ee49986a5d5919aa Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 1 Aug 2025 19:15:57 +0000 Subject: [PATCH 4/6] feat(api): lower default timeout to 5s --- .stats.yml | 2 +- README.md | 4 ++-- src/kernel/_constants.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.stats.yml b/.stats.yml index fbe1e82..c8304ed 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 19 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-9f2d347a4bcb03aed092ba4495aac090c3d988e9a99af091ee35c09994adad8b.yml openapi_spec_hash: 73b92bd5503ab6c64dc26da31cca36e2 -config_hash: 65328ff206b8c0168c915914506d9dba +config_hash: aafe2b8c43d82d9838c8b77cdd59189f diff --git a/README.md b/README.md index 884d10c..87e2b84 100644 --- a/README.md +++ b/README.md @@ -216,7 +216,7 @@ client.with_options(max_retries=5).browsers.create( ### Timeouts -By default requests time out after 1 minute. You can configure this with a `timeout` option, +By default requests time out after 5 seconds. You can configure this with a `timeout` option, which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object: ```python @@ -224,7 +224,7 @@ from kernel import Kernel # Configure the default for all requests: client = Kernel( - # 20 seconds (default is 1 minute) + # 20 seconds (default is 5 seconds) timeout=20.0, ) diff --git a/src/kernel/_constants.py b/src/kernel/_constants.py index 6ddf2c7..50a26f7 100644 --- a/src/kernel/_constants.py +++ b/src/kernel/_constants.py @@ -5,8 +5,8 @@ RAW_RESPONSE_HEADER = "X-Stainless-Raw-Response" OVERRIDE_CAST_TO_HEADER = "____stainless_override_cast_to" -# default timeout is 1 minute -DEFAULT_TIMEOUT = httpx.Timeout(timeout=60, connect=5.0) +# default timeout is 5 seconds +DEFAULT_TIMEOUT = httpx.Timeout(timeout=5, connect=5.0) DEFAULT_MAX_RETRIES = 2 DEFAULT_CONNECTION_LIMITS = httpx.Limits(max_connections=100, max_keepalive_connections=20) From c6990ba5c9974f96270e1ca86e9d7935d7db03d7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 1 Aug 2025 19:25:51 +0000 Subject: [PATCH 5/6] feat(api): manual updates --- .stats.yml | 2 +- README.md | 4 ++-- src/kernel/_constants.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.stats.yml b/.stats.yml index c8304ed..fbe1e82 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 19 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-9f2d347a4bcb03aed092ba4495aac090c3d988e9a99af091ee35c09994adad8b.yml openapi_spec_hash: 73b92bd5503ab6c64dc26da31cca36e2 -config_hash: aafe2b8c43d82d9838c8b77cdd59189f +config_hash: 65328ff206b8c0168c915914506d9dba diff --git a/README.md b/README.md index 87e2b84..884d10c 100644 --- a/README.md +++ b/README.md @@ -216,7 +216,7 @@ client.with_options(max_retries=5).browsers.create( ### Timeouts -By default requests time out after 5 seconds. You can configure this with a `timeout` option, +By default requests time out after 1 minute. You can configure this with a `timeout` option, which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object: ```python @@ -224,7 +224,7 @@ from kernel import Kernel # Configure the default for all requests: client = Kernel( - # 20 seconds (default is 5 seconds) + # 20 seconds (default is 1 minute) timeout=20.0, ) diff --git a/src/kernel/_constants.py b/src/kernel/_constants.py index 50a26f7..6ddf2c7 100644 --- a/src/kernel/_constants.py +++ b/src/kernel/_constants.py @@ -5,8 +5,8 @@ RAW_RESPONSE_HEADER = "X-Stainless-Raw-Response" OVERRIDE_CAST_TO_HEADER = "____stainless_override_cast_to" -# default timeout is 5 seconds -DEFAULT_TIMEOUT = httpx.Timeout(timeout=5, connect=5.0) +# default timeout is 1 minute +DEFAULT_TIMEOUT = httpx.Timeout(timeout=60, connect=5.0) DEFAULT_MAX_RETRIES = 2 DEFAULT_CONNECTION_LIMITS = httpx.Limits(max_connections=100, max_keepalive_connections=20) From df8bcea092651ab82106a645b3421f0df0e39cb0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 1 Aug 2025 19:26:07 +0000 Subject: [PATCH 6/6] release: 0.8.3 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 15 +++++++++++++++ pyproject.toml | 2 +- src/kernel/_version.py | 2 +- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 34dc535..a3bdfd2 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.8.2" + ".": "0.8.3" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a362ac..8fe9a35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## 0.8.3 (2025-08-01) + +Full Changelog: [v0.8.2...v0.8.3](https://github.com/onkernel/kernel-python-sdk/compare/v0.8.2...v0.8.3) + +### Features + +* **api:** lower default timeout to 5s ([6d43e73](https://github.com/onkernel/kernel-python-sdk/commit/6d43e73a5206d3faa99825d6ee49986a5d5919aa)) +* **api:** manual updates ([c6990ba](https://github.com/onkernel/kernel-python-sdk/commit/c6990ba5c9974f96270e1ca86e9d7935d7db03d7)) +* **client:** support file upload requests ([79b06da](https://github.com/onkernel/kernel-python-sdk/commit/79b06da326192ceb5edf703576bd25835cbed031)) + + +### Chores + +* **project:** add settings file for vscode ([c46aa48](https://github.com/onkernel/kernel-python-sdk/commit/c46aa48e7d07db3317b038c51b3c58a88b2d44d4)) + ## 0.8.2 (2025-07-23) Full Changelog: [v0.8.1...v0.8.2](https://github.com/onkernel/kernel-python-sdk/compare/v0.8.1...v0.8.2) diff --git a/pyproject.toml b/pyproject.toml index 5a5d20e..5927c84 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "kernel" -version = "0.8.2" +version = "0.8.3" description = "The official Python library for the kernel API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/kernel/_version.py b/src/kernel/_version.py index 0401c33..98240d7 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.8.2" # x-release-please-version +__version__ = "0.8.3" # x-release-please-version