Skip to content

Commit 4161ff3

Browse files
feat(api): update via SDK Studio
1 parent d584bd4 commit 4161ff3

File tree

7 files changed

+30
-28
lines changed

7 files changed

+30
-28
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 15
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hyperspell%2Fhyperspell-d2e76b9698a2b33ab32291eac7ffa9671fe0a65646e6ba53170beee2dd643123.yml
33
openapi_spec_hash: e4c39d8acf6435ae67ae263becf8dc47
4-
config_hash: 5032cd58fd48362144ae9765c1b5a8d6
4+
config_hash: c619117e0dcf8fc4e398e3b2861b5508

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,11 @@ from hyperspell import Hyperspell
191191

192192
client = Hyperspell()
193193

194-
response = client.memories.search(
194+
query = client.memories.search(
195195
query="query",
196196
options={},
197197
)
198-
print(response.options)
198+
print(query.options)
199199
```
200200

201201
## File uploads

api.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,7 @@ Methods:
4545
Types:
4646

4747
```python
48-
from hyperspell.types import (
49-
Memory,
50-
MemoryStatus,
51-
MemoryDeleteResponse,
52-
MemorySearchResponse,
53-
MemoryStatusResponse,
54-
)
48+
from hyperspell.types import Memory, MemoryStatus, MemoryDeleteResponse, MemoryStatusResponse
5549
```
5650

5751
Methods:
@@ -60,10 +54,18 @@ Methods:
6054
- <code title="delete /memories/delete/{source}/{resource_id}">client.memories.<a href="./src/hyperspell/resources/memories.py">delete</a>(resource_id, \*, source) -> <a href="./src/hyperspell/types/memory_delete_response.py">MemoryDeleteResponse</a></code>
6155
- <code title="post /memories/add">client.memories.<a href="./src/hyperspell/resources/memories.py">add</a>(\*\*<a href="src/hyperspell/types/memory_add_params.py">params</a>) -> <a href="./src/hyperspell/types/memory_status.py">MemoryStatus</a></code>
6256
- <code title="get /memories/get/{source}/{resource_id}">client.memories.<a href="./src/hyperspell/resources/memories.py">get</a>(resource_id, \*, source) -> <a href="./src/hyperspell/types/memory.py">Memory</a></code>
63-
- <code title="post /memories/query">client.memories.<a href="./src/hyperspell/resources/memories.py">search</a>(\*\*<a href="src/hyperspell/types/memory_search_params.py">params</a>) -> <a href="./src/hyperspell/types/memory_search_response.py">MemorySearchResponse</a></code>
57+
- <code title="post /memories/query">client.memories.<a href="./src/hyperspell/resources/memories.py">search</a>(\*\*<a href="src/hyperspell/types/memory_search_params.py">params</a>) -> <a href="./src/hyperspell/types/query.py">Query</a></code>
6458
- <code title="get /memories/status">client.memories.<a href="./src/hyperspell/resources/memories.py">status</a>() -> <a href="./src/hyperspell/types/memory_status_response.py">MemoryStatusResponse</a></code>
6559
- <code title="post /memories/upload">client.memories.<a href="./src/hyperspell/resources/memories.py">upload</a>(\*\*<a href="src/hyperspell/types/memory_upload_params.py">params</a>) -> <a href="./src/hyperspell/types/memory_status.py">MemoryStatus</a></code>
6660

61+
# Evaluate
62+
63+
Types:
64+
65+
```python
66+
from hyperspell.types import Query
67+
```
68+
6769
# Vaults
6870

6971
Types:

src/hyperspell/resources/memories.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
async_to_streamed_response_wrapper,
2121
)
2222
from ..pagination import SyncCursorPage, AsyncCursorPage
23+
from ..types.query import Query
2324
from .._base_client import AsyncPaginator, make_request_options
2425
from ..types.memory import Memory
2526
from ..types.memory_status import MemoryStatus
2627
from ..types.memory_delete_response import MemoryDeleteResponse
27-
from ..types.memory_search_response import MemorySearchResponse
2828
from ..types.memory_status_response import MemoryStatusResponse
2929

3030
__all__ = ["MemoriesResource", "AsyncMemoriesResource"]
@@ -459,7 +459,7 @@ def search(
459459
extra_query: Query | None = None,
460460
extra_body: Body | None = None,
461461
timeout: float | httpx.Timeout | None | NotGiven = not_given,
462-
) -> MemorySearchResponse:
462+
) -> Query:
463463
"""
464464
Retrieves documents matching the query.
465465
@@ -497,7 +497,7 @@ def search(
497497
options=make_request_options(
498498
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
499499
),
500-
cast_to=MemorySearchResponse,
500+
cast_to=Query,
501501
)
502502

503503
def status(
@@ -1005,7 +1005,7 @@ async def search(
10051005
extra_query: Query | None = None,
10061006
extra_body: Body | None = None,
10071007
timeout: float | httpx.Timeout | None | NotGiven = not_given,
1008-
) -> MemorySearchResponse:
1008+
) -> Query:
10091009
"""
10101010
Retrieves documents matching the query.
10111011
@@ -1043,7 +1043,7 @@ async def search(
10431043
options=make_request_options(
10441044
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
10451045
),
1046-
cast_to=MemorySearchResponse,
1046+
cast_to=Query,
10471047
)
10481048

10491049
async def status(

src/hyperspell/types/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from __future__ import annotations
44

5+
from .query import Query as Query
56
from .token import Token as Token
67
from .memory import Memory as Memory
78
from .memory_status import MemoryStatus as MemoryStatus
@@ -14,7 +15,6 @@
1415
from .memory_upload_params import MemoryUploadParams as MemoryUploadParams
1516
from .auth_user_token_params import AuthUserTokenParams as AuthUserTokenParams
1617
from .memory_delete_response import MemoryDeleteResponse as MemoryDeleteResponse
17-
from .memory_search_response import MemorySearchResponse as MemorySearchResponse
1818
from .memory_status_response import MemoryStatusResponse as MemoryStatusResponse
1919
from .auth_delete_user_response import AuthDeleteUserResponse as AuthDeleteUserResponse
2020
from .integration_revoke_response import IntegrationRevokeResponse as IntegrationRevokeResponse

src/hyperspell/types/memory_search_response.py renamed to src/hyperspell/types/query.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
from .memory import Memory
66
from .._models import BaseModel
77

8-
__all__ = ["MemorySearchResponse"]
8+
__all__ = ["Query"]
99

1010

11-
class MemorySearchResponse(BaseModel):
11+
class Query(BaseModel):
1212
documents: List[Memory]
1313

1414
answer: Optional[str] = None

tests/api_resources/test_memories.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
from hyperspell import Hyperspell, AsyncHyperspell
1111
from tests.utils import assert_matches_type
1212
from hyperspell.types import (
13+
Query,
1314
Memory,
1415
MemoryStatus,
1516
MemoryDeleteResponse,
16-
MemorySearchResponse,
1717
MemoryStatusResponse,
1818
)
1919
from hyperspell._utils import parse_datetime
@@ -191,7 +191,7 @@ def test_method_search(self, client: Hyperspell) -> None:
191191
memory = client.memories.search(
192192
query="query",
193193
)
194-
assert_matches_type(MemorySearchResponse, memory, path=["response"])
194+
assert_matches_type(Query, memory, path=["response"])
195195

196196
@parametrize
197197
def test_method_search_with_all_params(self, client: Hyperspell) -> None:
@@ -265,7 +265,7 @@ def test_method_search_with_all_params(self, client: Hyperspell) -> None:
265265
},
266266
sources=["collections"],
267267
)
268-
assert_matches_type(MemorySearchResponse, memory, path=["response"])
268+
assert_matches_type(Query, memory, path=["response"])
269269

270270
@parametrize
271271
def test_raw_response_search(self, client: Hyperspell) -> None:
@@ -276,7 +276,7 @@ def test_raw_response_search(self, client: Hyperspell) -> None:
276276
assert response.is_closed is True
277277
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
278278
memory = response.parse()
279-
assert_matches_type(MemorySearchResponse, memory, path=["response"])
279+
assert_matches_type(Query, memory, path=["response"])
280280

281281
@parametrize
282282
def test_streaming_response_search(self, client: Hyperspell) -> None:
@@ -287,7 +287,7 @@ def test_streaming_response_search(self, client: Hyperspell) -> None:
287287
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
288288

289289
memory = response.parse()
290-
assert_matches_type(MemorySearchResponse, memory, path=["response"])
290+
assert_matches_type(Query, memory, path=["response"])
291291

292292
assert cast(Any, response.is_closed) is True
293293

@@ -527,7 +527,7 @@ async def test_method_search(self, async_client: AsyncHyperspell) -> None:
527527
memory = await async_client.memories.search(
528528
query="query",
529529
)
530-
assert_matches_type(MemorySearchResponse, memory, path=["response"])
530+
assert_matches_type(Query, memory, path=["response"])
531531

532532
@parametrize
533533
async def test_method_search_with_all_params(self, async_client: AsyncHyperspell) -> None:
@@ -601,7 +601,7 @@ async def test_method_search_with_all_params(self, async_client: AsyncHyperspell
601601
},
602602
sources=["collections"],
603603
)
604-
assert_matches_type(MemorySearchResponse, memory, path=["response"])
604+
assert_matches_type(Query, memory, path=["response"])
605605

606606
@parametrize
607607
async def test_raw_response_search(self, async_client: AsyncHyperspell) -> None:
@@ -612,7 +612,7 @@ async def test_raw_response_search(self, async_client: AsyncHyperspell) -> None:
612612
assert response.is_closed is True
613613
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
614614
memory = await response.parse()
615-
assert_matches_type(MemorySearchResponse, memory, path=["response"])
615+
assert_matches_type(Query, memory, path=["response"])
616616

617617
@parametrize
618618
async def test_streaming_response_search(self, async_client: AsyncHyperspell) -> None:
@@ -623,7 +623,7 @@ async def test_streaming_response_search(self, async_client: AsyncHyperspell) ->
623623
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
624624

625625
memory = await response.parse()
626-
assert_matches_type(MemorySearchResponse, memory, path=["response"])
626+
assert_matches_type(Query, memory, path=["response"])
627627

628628
assert cast(Any, response.is_closed) is True
629629

0 commit comments

Comments
 (0)