From bd3a602618afa61ac40af3caed3e60f6e63229ed Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 15 Dec 2025 23:10:33 +0000 Subject: [PATCH 1/6] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index f9df407..72cccfe 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 22 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hyperspell%2Fhyperspell-fc4ab722e6762cc69d533f57bea0d70b00e44a30c4ad8144e14ff70a1170ec7c.yml openapi_spec_hash: 2533ea676c195d5f7d30a67c201fd32d -config_hash: 5cb785fcdf07e4053f36b434e1db2d8a +config_hash: 5b22718d6a289258de8dc7676abb51c5 From 22826f97b3edf8910eda4be67aa1c2e5dfdf200b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 16 Dec 2025 05:25:43 +0000 Subject: [PATCH 2/6] chore(internal): add missing files argument to base client --- src/hyperspell/_base_client.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/hyperspell/_base_client.py b/src/hyperspell/_base_client.py index fbf8d39..a07a877 100644 --- a/src/hyperspell/_base_client.py +++ b/src/hyperspell/_base_client.py @@ -1247,9 +1247,12 @@ def patch( *, cast_to: Type[ResponseT], body: Body | None = None, + files: RequestFiles | None = None, options: RequestOptions = {}, ) -> ResponseT: - opts = FinalRequestOptions.construct(method="patch", url=path, json_data=body, **options) + opts = FinalRequestOptions.construct( + method="patch", url=path, json_data=body, files=to_httpx_files(files), **options + ) return self.request(cast_to, opts) def put( @@ -1767,9 +1770,12 @@ async def patch( *, cast_to: Type[ResponseT], body: Body | None = None, + files: RequestFiles | None = None, options: RequestOptions = {}, ) -> ResponseT: - opts = FinalRequestOptions.construct(method="patch", url=path, json_data=body, **options) + opts = FinalRequestOptions.construct( + method="patch", url=path, json_data=body, files=to_httpx_files(files), **options + ) return await self.request(cast_to, opts) async def put( From b39343e600358251c604ee2d0232b3af538172f5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 17 Dec 2025 08:25:53 +0000 Subject: [PATCH 3/6] chore: speedup initial import --- src/hyperspell/_client.py | 314 ++++++++++++++++++++++++++++++-------- 1 file changed, 253 insertions(+), 61 deletions(-) diff --git a/src/hyperspell/_client.py b/src/hyperspell/_client.py index a41a2c8..7d68518 100644 --- a/src/hyperspell/_client.py +++ b/src/hyperspell/_client.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, Mapping +from typing import TYPE_CHECKING, Any, Mapping from typing_extensions import Self, override import httpx @@ -20,8 +20,8 @@ not_given, ) from ._utils import is_given, get_async_library +from ._compat import cached_property from ._version import __version__ -from .resources import auth, vaults, evaluate, memories, connections from ._streaming import Stream as Stream, AsyncStream as AsyncStream from ._exceptions import APIStatusError, HyperspellError from ._base_client import ( @@ -29,7 +29,15 @@ SyncAPIClient, AsyncAPIClient, ) -from .resources.integrations import integrations + +if TYPE_CHECKING: + from .resources import auth, vaults, evaluate, memories, connections, integrations + from .resources.auth import AuthResource, AsyncAuthResource + from .resources.vaults import VaultsResource, AsyncVaultsResource + from .resources.evaluate import EvaluateResource, AsyncEvaluateResource + from .resources.memories import MemoriesResource, AsyncMemoriesResource + from .resources.connections import ConnectionsResource, AsyncConnectionsResource + from .resources.integrations.integrations import IntegrationsResource, AsyncIntegrationsResource __all__ = [ "Timeout", @@ -44,15 +52,6 @@ class Hyperspell(SyncAPIClient): - connections: connections.ConnectionsResource - integrations: integrations.IntegrationsResource - memories: memories.MemoriesResource - evaluate: evaluate.EvaluateResource - vaults: vaults.VaultsResource - auth: auth.AuthResource - with_raw_response: HyperspellWithRawResponse - with_streaming_response: HyperspellWithStreamedResponse - # client options api_key: str user_id: str | None @@ -111,14 +110,49 @@ def __init__( _strict_response_validation=_strict_response_validation, ) - self.connections = connections.ConnectionsResource(self) - self.integrations = integrations.IntegrationsResource(self) - self.memories = memories.MemoriesResource(self) - self.evaluate = evaluate.EvaluateResource(self) - self.vaults = vaults.VaultsResource(self) - self.auth = auth.AuthResource(self) - self.with_raw_response = HyperspellWithRawResponse(self) - self.with_streaming_response = HyperspellWithStreamedResponse(self) + @cached_property + def connections(self) -> ConnectionsResource: + from .resources.connections import ConnectionsResource + + return ConnectionsResource(self) + + @cached_property + def integrations(self) -> IntegrationsResource: + from .resources.integrations import IntegrationsResource + + return IntegrationsResource(self) + + @cached_property + def memories(self) -> MemoriesResource: + from .resources.memories import MemoriesResource + + return MemoriesResource(self) + + @cached_property + def evaluate(self) -> EvaluateResource: + from .resources.evaluate import EvaluateResource + + return EvaluateResource(self) + + @cached_property + def vaults(self) -> VaultsResource: + from .resources.vaults import VaultsResource + + return VaultsResource(self) + + @cached_property + def auth(self) -> AuthResource: + from .resources.auth import AuthResource + + return AuthResource(self) + + @cached_property + def with_raw_response(self) -> HyperspellWithRawResponse: + return HyperspellWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> HyperspellWithStreamedResponse: + return HyperspellWithStreamedResponse(self) @property @override @@ -239,15 +273,6 @@ def _make_status_error( class AsyncHyperspell(AsyncAPIClient): - connections: connections.AsyncConnectionsResource - integrations: integrations.AsyncIntegrationsResource - memories: memories.AsyncMemoriesResource - evaluate: evaluate.AsyncEvaluateResource - vaults: vaults.AsyncVaultsResource - auth: auth.AsyncAuthResource - with_raw_response: AsyncHyperspellWithRawResponse - with_streaming_response: AsyncHyperspellWithStreamedResponse - # client options api_key: str user_id: str | None @@ -306,14 +331,49 @@ def __init__( _strict_response_validation=_strict_response_validation, ) - self.connections = connections.AsyncConnectionsResource(self) - self.integrations = integrations.AsyncIntegrationsResource(self) - self.memories = memories.AsyncMemoriesResource(self) - self.evaluate = evaluate.AsyncEvaluateResource(self) - self.vaults = vaults.AsyncVaultsResource(self) - self.auth = auth.AsyncAuthResource(self) - self.with_raw_response = AsyncHyperspellWithRawResponse(self) - self.with_streaming_response = AsyncHyperspellWithStreamedResponse(self) + @cached_property + def connections(self) -> AsyncConnectionsResource: + from .resources.connections import AsyncConnectionsResource + + return AsyncConnectionsResource(self) + + @cached_property + def integrations(self) -> AsyncIntegrationsResource: + from .resources.integrations import AsyncIntegrationsResource + + return AsyncIntegrationsResource(self) + + @cached_property + def memories(self) -> AsyncMemoriesResource: + from .resources.memories import AsyncMemoriesResource + + return AsyncMemoriesResource(self) + + @cached_property + def evaluate(self) -> AsyncEvaluateResource: + from .resources.evaluate import AsyncEvaluateResource + + return AsyncEvaluateResource(self) + + @cached_property + def vaults(self) -> AsyncVaultsResource: + from .resources.vaults import AsyncVaultsResource + + return AsyncVaultsResource(self) + + @cached_property + def auth(self) -> AsyncAuthResource: + from .resources.auth import AsyncAuthResource + + return AsyncAuthResource(self) + + @cached_property + def with_raw_response(self) -> AsyncHyperspellWithRawResponse: + return AsyncHyperspellWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncHyperspellWithStreamedResponse: + return AsyncHyperspellWithStreamedResponse(self) @property @override @@ -434,43 +494,175 @@ def _make_status_error( class HyperspellWithRawResponse: + _client: Hyperspell + def __init__(self, client: Hyperspell) -> None: - self.connections = connections.ConnectionsResourceWithRawResponse(client.connections) - self.integrations = integrations.IntegrationsResourceWithRawResponse(client.integrations) - self.memories = memories.MemoriesResourceWithRawResponse(client.memories) - self.evaluate = evaluate.EvaluateResourceWithRawResponse(client.evaluate) - self.vaults = vaults.VaultsResourceWithRawResponse(client.vaults) - self.auth = auth.AuthResourceWithRawResponse(client.auth) + self._client = client + + @cached_property + def connections(self) -> connections.ConnectionsResourceWithRawResponse: + from .resources.connections import ConnectionsResourceWithRawResponse + + return ConnectionsResourceWithRawResponse(self._client.connections) + + @cached_property + def integrations(self) -> integrations.IntegrationsResourceWithRawResponse: + from .resources.integrations import IntegrationsResourceWithRawResponse + + return IntegrationsResourceWithRawResponse(self._client.integrations) + + @cached_property + def memories(self) -> memories.MemoriesResourceWithRawResponse: + from .resources.memories import MemoriesResourceWithRawResponse + + return MemoriesResourceWithRawResponse(self._client.memories) + + @cached_property + def evaluate(self) -> evaluate.EvaluateResourceWithRawResponse: + from .resources.evaluate import EvaluateResourceWithRawResponse + + return EvaluateResourceWithRawResponse(self._client.evaluate) + + @cached_property + def vaults(self) -> vaults.VaultsResourceWithRawResponse: + from .resources.vaults import VaultsResourceWithRawResponse + + return VaultsResourceWithRawResponse(self._client.vaults) + + @cached_property + def auth(self) -> auth.AuthResourceWithRawResponse: + from .resources.auth import AuthResourceWithRawResponse + + return AuthResourceWithRawResponse(self._client.auth) class AsyncHyperspellWithRawResponse: + _client: AsyncHyperspell + def __init__(self, client: AsyncHyperspell) -> None: - self.connections = connections.AsyncConnectionsResourceWithRawResponse(client.connections) - self.integrations = integrations.AsyncIntegrationsResourceWithRawResponse(client.integrations) - self.memories = memories.AsyncMemoriesResourceWithRawResponse(client.memories) - self.evaluate = evaluate.AsyncEvaluateResourceWithRawResponse(client.evaluate) - self.vaults = vaults.AsyncVaultsResourceWithRawResponse(client.vaults) - self.auth = auth.AsyncAuthResourceWithRawResponse(client.auth) + self._client = client + + @cached_property + def connections(self) -> connections.AsyncConnectionsResourceWithRawResponse: + from .resources.connections import AsyncConnectionsResourceWithRawResponse + + return AsyncConnectionsResourceWithRawResponse(self._client.connections) + + @cached_property + def integrations(self) -> integrations.AsyncIntegrationsResourceWithRawResponse: + from .resources.integrations import AsyncIntegrationsResourceWithRawResponse + + return AsyncIntegrationsResourceWithRawResponse(self._client.integrations) + + @cached_property + def memories(self) -> memories.AsyncMemoriesResourceWithRawResponse: + from .resources.memories import AsyncMemoriesResourceWithRawResponse + + return AsyncMemoriesResourceWithRawResponse(self._client.memories) + + @cached_property + def evaluate(self) -> evaluate.AsyncEvaluateResourceWithRawResponse: + from .resources.evaluate import AsyncEvaluateResourceWithRawResponse + + return AsyncEvaluateResourceWithRawResponse(self._client.evaluate) + + @cached_property + def vaults(self) -> vaults.AsyncVaultsResourceWithRawResponse: + from .resources.vaults import AsyncVaultsResourceWithRawResponse + + return AsyncVaultsResourceWithRawResponse(self._client.vaults) + + @cached_property + def auth(self) -> auth.AsyncAuthResourceWithRawResponse: + from .resources.auth import AsyncAuthResourceWithRawResponse + + return AsyncAuthResourceWithRawResponse(self._client.auth) class HyperspellWithStreamedResponse: + _client: Hyperspell + def __init__(self, client: Hyperspell) -> None: - self.connections = connections.ConnectionsResourceWithStreamingResponse(client.connections) - self.integrations = integrations.IntegrationsResourceWithStreamingResponse(client.integrations) - self.memories = memories.MemoriesResourceWithStreamingResponse(client.memories) - self.evaluate = evaluate.EvaluateResourceWithStreamingResponse(client.evaluate) - self.vaults = vaults.VaultsResourceWithStreamingResponse(client.vaults) - self.auth = auth.AuthResourceWithStreamingResponse(client.auth) + self._client = client + + @cached_property + def connections(self) -> connections.ConnectionsResourceWithStreamingResponse: + from .resources.connections import ConnectionsResourceWithStreamingResponse + + return ConnectionsResourceWithStreamingResponse(self._client.connections) + + @cached_property + def integrations(self) -> integrations.IntegrationsResourceWithStreamingResponse: + from .resources.integrations import IntegrationsResourceWithStreamingResponse + + return IntegrationsResourceWithStreamingResponse(self._client.integrations) + + @cached_property + def memories(self) -> memories.MemoriesResourceWithStreamingResponse: + from .resources.memories import MemoriesResourceWithStreamingResponse + + return MemoriesResourceWithStreamingResponse(self._client.memories) + + @cached_property + def evaluate(self) -> evaluate.EvaluateResourceWithStreamingResponse: + from .resources.evaluate import EvaluateResourceWithStreamingResponse + + return EvaluateResourceWithStreamingResponse(self._client.evaluate) + + @cached_property + def vaults(self) -> vaults.VaultsResourceWithStreamingResponse: + from .resources.vaults import VaultsResourceWithStreamingResponse + + return VaultsResourceWithStreamingResponse(self._client.vaults) + + @cached_property + def auth(self) -> auth.AuthResourceWithStreamingResponse: + from .resources.auth import AuthResourceWithStreamingResponse + + return AuthResourceWithStreamingResponse(self._client.auth) class AsyncHyperspellWithStreamedResponse: + _client: AsyncHyperspell + def __init__(self, client: AsyncHyperspell) -> None: - self.connections = connections.AsyncConnectionsResourceWithStreamingResponse(client.connections) - self.integrations = integrations.AsyncIntegrationsResourceWithStreamingResponse(client.integrations) - self.memories = memories.AsyncMemoriesResourceWithStreamingResponse(client.memories) - self.evaluate = evaluate.AsyncEvaluateResourceWithStreamingResponse(client.evaluate) - self.vaults = vaults.AsyncVaultsResourceWithStreamingResponse(client.vaults) - self.auth = auth.AsyncAuthResourceWithStreamingResponse(client.auth) + self._client = client + + @cached_property + def connections(self) -> connections.AsyncConnectionsResourceWithStreamingResponse: + from .resources.connections import AsyncConnectionsResourceWithStreamingResponse + + return AsyncConnectionsResourceWithStreamingResponse(self._client.connections) + + @cached_property + def integrations(self) -> integrations.AsyncIntegrationsResourceWithStreamingResponse: + from .resources.integrations import AsyncIntegrationsResourceWithStreamingResponse + + return AsyncIntegrationsResourceWithStreamingResponse(self._client.integrations) + + @cached_property + def memories(self) -> memories.AsyncMemoriesResourceWithStreamingResponse: + from .resources.memories import AsyncMemoriesResourceWithStreamingResponse + + return AsyncMemoriesResourceWithStreamingResponse(self._client.memories) + + @cached_property + def evaluate(self) -> evaluate.AsyncEvaluateResourceWithStreamingResponse: + from .resources.evaluate import AsyncEvaluateResourceWithStreamingResponse + + return AsyncEvaluateResourceWithStreamingResponse(self._client.evaluate) + + @cached_property + def vaults(self) -> vaults.AsyncVaultsResourceWithStreamingResponse: + from .resources.vaults import AsyncVaultsResourceWithStreamingResponse + + return AsyncVaultsResourceWithStreamingResponse(self._client.vaults) + + @cached_property + def auth(self) -> auth.AsyncAuthResourceWithStreamingResponse: + from .resources.auth import AsyncAuthResourceWithStreamingResponse + + return AsyncAuthResourceWithStreamingResponse(self._client.auth) Client = Hyperspell From 4116107e99dbe09a060f53ebfedcf1ff58715674 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 18 Dec 2025 09:59:02 +0000 Subject: [PATCH 4/6] fix: use async_to_httpx_files in patch method --- src/hyperspell/_base_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hyperspell/_base_client.py b/src/hyperspell/_base_client.py index a07a877..823c3a9 100644 --- a/src/hyperspell/_base_client.py +++ b/src/hyperspell/_base_client.py @@ -1774,7 +1774,7 @@ async def patch( options: RequestOptions = {}, ) -> ResponseT: opts = FinalRequestOptions.construct( - method="patch", url=path, json_data=body, files=to_httpx_files(files), **options + method="patch", url=path, json_data=body, files=await async_to_httpx_files(files), **options ) return await self.request(cast_to, opts) From 9d02a464264ed187e3072c7b9337c14101b21945 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 19 Dec 2025 08:24:31 +0000 Subject: [PATCH 5/6] chore(internal): add `--fix` argument to lint script --- scripts/lint | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/lint b/scripts/lint index 6453a7b..9d4a19f 100755 --- a/scripts/lint +++ b/scripts/lint @@ -4,8 +4,13 @@ set -e cd "$(dirname "$0")/.." -echo "==> Running lints" -rye run lint +if [ "$1" = "--fix" ]; then + echo "==> Running lints with --fix" + rye run fix:ruff +else + echo "==> Running lints" + rye run lint +fi echo "==> Making sure it imports" rye run python -c 'import hyperspell' From 09c28e2d2eba73c34edff2e6dfa3e3e038f58d5d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 19 Dec 2025 08:24:49 +0000 Subject: [PATCH 6/6] release: 0.28.1 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 15 +++++++++++++++ pyproject.toml | 2 +- src/hyperspell/_version.py | 2 +- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 8935e93..a6fc929 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.28.0" + ".": "0.28.1" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index e0dab30..da64079 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## 0.28.1 (2025-12-19) + +Full Changelog: [v0.28.0...v0.28.1](https://github.com/hyperspell/python-sdk/compare/v0.28.0...v0.28.1) + +### Bug Fixes + +* use async_to_httpx_files in patch method ([4116107](https://github.com/hyperspell/python-sdk/commit/4116107e99dbe09a060f53ebfedcf1ff58715674)) + + +### Chores + +* **internal:** add `--fix` argument to lint script ([9d02a46](https://github.com/hyperspell/python-sdk/commit/9d02a464264ed187e3072c7b9337c14101b21945)) +* **internal:** add missing files argument to base client ([22826f9](https://github.com/hyperspell/python-sdk/commit/22826f97b3edf8910eda4be67aa1c2e5dfdf200b)) +* speedup initial import ([b39343e](https://github.com/hyperspell/python-sdk/commit/b39343e600358251c604ee2d0232b3af538172f5)) + ## 0.28.0 (2025-12-15) Full Changelog: [v0.27.0...v0.28.0](https://github.com/hyperspell/python-sdk/compare/v0.27.0...v0.28.0) diff --git a/pyproject.toml b/pyproject.toml index 87fff54..5a3287b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "hyperspell" -version = "0.28.0" +version = "0.28.1" description = "The official Python library for the hyperspell API" dynamic = ["readme"] license = "MIT" diff --git a/src/hyperspell/_version.py b/src/hyperspell/_version.py index 1223a2c..515b53b 100644 --- a/src/hyperspell/_version.py +++ b/src/hyperspell/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "hyperspell" -__version__ = "0.28.0" # x-release-please-version +__version__ = "0.28.1" # x-release-please-version