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.21.0"
".": "0.22.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 13
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hyperspell%2Fhyperspell-14d23949fc9a5cf375c542a7a2bda08334079fab55f43b80a3d94ede34244da3.yml
openapi_spec_hash: b80c4f0e0311ff9125dfe27a5a405395
config_hash: bf6196b98ec72829d458bc45ccd5a5f9
configured_endpoints: 14
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hyperspell%2Fhyperspell-ec1420af27ac837f49a977cb95726af45a5ee5b5cd367e54b8a611de47ee3c84.yml
openapi_spec_hash: 0fc5dd84801ee8f46a9b5d0941bdefda
config_hash: 985dd1bd217ba3c5c5b614da08d43e5f
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## 0.22.0 (2025-08-06)

Full Changelog: [v0.21.0...v0.22.0](https://github.com/hyperspell/python-sdk/compare/v0.21.0...v0.22.0)

### Features

* **api:** api update ([853645f](https://github.com/hyperspell/python-sdk/commit/853645f31184d6be577afe6ef7e872bca5198b3c))
* **api:** api update ([e6c05cd](https://github.com/hyperspell/python-sdk/commit/e6c05cd496db6e9df09da720bd74e6c2f0f853b7))
* **api:** update via SDK Studio ([5d3bc9c](https://github.com/hyperspell/python-sdk/commit/5d3bc9c68523ff572bb27e8d77e24a2819f6e6be))
* **api:** update via SDK Studio ([37def01](https://github.com/hyperspell/python-sdk/commit/37def01e5290efee8228c0e81f6ef2c9e7fb2b0b))


### Chores

* **internal:** fix ruff target version ([9454556](https://github.com/hyperspell/python-sdk/commit/945455659b4896b89be368476adeb8c062e8d520))

## 0.21.0 (2025-08-05)

Full Changelog: [v0.20.0...v0.21.0](https://github.com/hyperspell/python-sdk/compare/v0.20.0...v0.21.0)
Expand Down
3 changes: 2 additions & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,11 @@ Methods:
Types:

```python
from hyperspell.types import Token, AuthMeResponse
from hyperspell.types import Token, AuthDeleteUserResponse, AuthMeResponse
```

Methods:

- <code title="delete /auth/delete">client.auth.<a href="./src/hyperspell/resources/auth.py">delete_user</a>() -> <a href="./src/hyperspell/types/auth_delete_user_response.py">AuthDeleteUserResponse</a></code>
- <code title="get /auth/me">client.auth.<a href="./src/hyperspell/resources/auth.py">me</a>() -> <a href="./src/hyperspell/types/auth_me_response.py">AuthMeResponse</a></code>
- <code title="post /auth/user_token">client.auth.<a href="./src/hyperspell/resources/auth.py">user_token</a>(\*\*<a href="src/hyperspell/types/auth_user_token_params.py">params</a>) -> <a href="./src/hyperspell/types/token.py">Token</a></code>
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "hyperspell"
version = "0.21.0"
version = "0.22.0"
description = "The official Python library for the hyperspell API"
dynamic = ["readme"]
license = "MIT"
Expand Down Expand Up @@ -159,7 +159,7 @@ reportPrivateUsage = false
[tool.ruff]
line-length = 120
output-format = "grouped"
target-version = "py37"
target-version = "py38"

[tool.ruff.format]
docstring-code-format = true
Expand Down
2 changes: 1 addition & 1 deletion src/hyperspell/_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__ = "hyperspell"
__version__ = "0.21.0" # x-release-please-version
__version__ = "0.22.0" # x-release-please-version
51 changes: 51 additions & 0 deletions src/hyperspell/resources/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from ..types.token import Token
from .._base_client import make_request_options
from ..types.auth_me_response import AuthMeResponse
from ..types.auth_delete_user_response import AuthDeleteUserResponse

__all__ = ["AuthResource", "AsyncAuthResource"]

Expand All @@ -44,6 +45,25 @@ def with_streaming_response(self) -> AuthResourceWithStreamingResponse:
"""
return AuthResourceWithStreamingResponse(self)

def delete_user(
self,
*,
# 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,
) -> AuthDeleteUserResponse:
"""Endpoint to delete user."""
return self._delete(
"/auth/delete",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=AuthDeleteUserResponse,
)

def me(
self,
*,
Expand Down Expand Up @@ -127,6 +147,25 @@ def with_streaming_response(self) -> AsyncAuthResourceWithStreamingResponse:
"""
return AsyncAuthResourceWithStreamingResponse(self)

async def delete_user(
self,
*,
# 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,
) -> AuthDeleteUserResponse:
"""Endpoint to delete user."""
return await self._delete(
"/auth/delete",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=AuthDeleteUserResponse,
)

async def me(
self,
*,
Expand Down Expand Up @@ -194,6 +233,9 @@ class AuthResourceWithRawResponse:
def __init__(self, auth: AuthResource) -> None:
self._auth = auth

self.delete_user = to_raw_response_wrapper(
auth.delete_user,
)
self.me = to_raw_response_wrapper(
auth.me,
)
Expand All @@ -206,6 +248,9 @@ class AsyncAuthResourceWithRawResponse:
def __init__(self, auth: AsyncAuthResource) -> None:
self._auth = auth

self.delete_user = async_to_raw_response_wrapper(
auth.delete_user,
)
self.me = async_to_raw_response_wrapper(
auth.me,
)
Expand All @@ -218,6 +263,9 @@ class AuthResourceWithStreamingResponse:
def __init__(self, auth: AuthResource) -> None:
self._auth = auth

self.delete_user = to_streamed_response_wrapper(
auth.delete_user,
)
self.me = to_streamed_response_wrapper(
auth.me,
)
Expand All @@ -230,6 +278,9 @@ class AsyncAuthResourceWithStreamingResponse:
def __init__(self, auth: AsyncAuthResource) -> None:
self._auth = auth

self.delete_user = async_to_streamed_response_wrapper(
auth.delete_user,
)
self.me = async_to_streamed_response_wrapper(
auth.me,
)
Expand Down
1 change: 1 addition & 0 deletions src/hyperspell/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@
from .memory_delete_response import MemoryDeleteResponse as MemoryDeleteResponse
from .memory_search_response import MemorySearchResponse as MemorySearchResponse
from .memory_status_response import MemoryStatusResponse as MemoryStatusResponse
from .auth_delete_user_response import AuthDeleteUserResponse as AuthDeleteUserResponse
from .integration_revoke_response import IntegrationRevokeResponse as IntegrationRevokeResponse
11 changes: 11 additions & 0 deletions src/hyperspell/types/auth_delete_user_response.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from .._models import BaseModel

__all__ = ["AuthDeleteUserResponse"]


class AuthDeleteUserResponse(BaseModel):
message: str

success: bool
2 changes: 2 additions & 0 deletions src/hyperspell/types/memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,5 @@ class Memory(BaseModel):

score: Optional[float] = None
"""The relevance of the resource to the query"""

title: Optional[str] = None
52 changes: 51 additions & 1 deletion tests/api_resources/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,39 @@

from hyperspell import Hyperspell, AsyncHyperspell
from tests.utils import assert_matches_type
from hyperspell.types import Token, AuthMeResponse
from hyperspell.types import Token, AuthMeResponse, AuthDeleteUserResponse

base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")


class TestAuth:
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])

@parametrize
def test_method_delete_user(self, client: Hyperspell) -> None:
auth = client.auth.delete_user()
assert_matches_type(AuthDeleteUserResponse, auth, path=["response"])

@parametrize
def test_raw_response_delete_user(self, client: Hyperspell) -> None:
response = client.auth.with_raw_response.delete_user()

assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
auth = response.parse()
assert_matches_type(AuthDeleteUserResponse, auth, path=["response"])

@parametrize
def test_streaming_response_delete_user(self, client: Hyperspell) -> None:
with client.auth.with_streaming_response.delete_user() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"

auth = response.parse()
assert_matches_type(AuthDeleteUserResponse, auth, path=["response"])

assert cast(Any, response.is_closed) is True

@parametrize
def test_method_me(self, client: Hyperspell) -> None:
auth = client.auth.me()
Expand Down Expand Up @@ -87,6 +112,31 @@ class TestAsyncAuth:
"async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
)

@parametrize
async def test_method_delete_user(self, async_client: AsyncHyperspell) -> None:
auth = await async_client.auth.delete_user()
assert_matches_type(AuthDeleteUserResponse, auth, path=["response"])

@parametrize
async def test_raw_response_delete_user(self, async_client: AsyncHyperspell) -> None:
response = await async_client.auth.with_raw_response.delete_user()

assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
auth = await response.parse()
assert_matches_type(AuthDeleteUserResponse, auth, path=["response"])

@parametrize
async def test_streaming_response_delete_user(self, async_client: AsyncHyperspell) -> None:
async with async_client.auth.with_streaming_response.delete_user() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"

auth = await response.parse()
assert_matches_type(AuthDeleteUserResponse, auth, path=["response"])

assert cast(Any, response.is_closed) is True

@parametrize
async def test_method_me(self, async_client: AsyncHyperspell) -> None:
auth = await async_client.auth.me()
Expand Down