Skip to content

Commit 20bf1bb

Browse files
feat(api): update via SDK Studio
1 parent 1e53d21 commit 20bf1bb

9 files changed

Lines changed: 72 additions & 72 deletions

File tree

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 12
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hyperspell%2Fhyperspell-4bfa5ab6a0021f526d6f6f622f1872f2ec3467b6d1bd51acfc17bfc6f399f915.yml
33
openapi_spec_hash: 5b51df5010bab70a1f3f884552ce25c3
4-
config_hash: 22d90fc758c675b134ffcbbadd4b9be1
4+
config_hash: c894437241b21cedd2d01854f1c7a8ef

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ client = Hyperspell(
3232
api_key=os.environ.get("HYPERSPELL_TOKEN"), # This is the default and can be omitted
3333
)
3434

35-
document_status = client.memories.add(
35+
memory_status = client.memories.add(
3636
text="text",
3737
)
38-
print(document_status.id)
38+
print(memory_status.id)
3939
```
4040

4141
While you can provide an `api_key` keyword argument,
@@ -58,10 +58,10 @@ client = AsyncHyperspell(
5858

5959

6060
async def main() -> None:
61-
document_status = await client.memories.add(
61+
memory_status = await client.memories.add(
6262
text="text",
6363
)
64-
print(document_status.id)
64+
print(memory_status.id)
6565

6666

6767
asyncio.run(main())
@@ -93,10 +93,10 @@ async def main() -> None:
9393
api_key="My API Key",
9494
http_client=DefaultAioHttpClient(),
9595
) as client:
96-
document_status = await client.memories.add(
96+
memory_status = await client.memories.add(
9797
text="text",
9898
)
99-
print(document_status.id)
99+
print(memory_status.id)
100100

101101

102102
asyncio.run(main())

api.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,17 @@ Methods:
3939
Types:
4040

4141
```python
42-
from hyperspell.types import Document, DocumentStatus, MemorySearchResponse, MemoryStatusResponse
42+
from hyperspell.types import Memory, MemoryStatus, MemorySearchResponse, MemoryStatusResponse
4343
```
4444

4545
Methods:
4646

47-
- <code title="get /memories/list">client.memories.<a href="./src/hyperspell/resources/memories.py">list</a>(\*\*<a href="src/hyperspell/types/memory_list_params.py">params</a>) -> <a href="./src/hyperspell/types/document.py">SyncCursorPage[Document]</a></code>
48-
- <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/document_status.py">DocumentStatus</a></code>
49-
- <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/document.py">Document</a></code>
47+
- <code title="get /memories/list">client.memories.<a href="./src/hyperspell/resources/memories.py">list</a>(\*\*<a href="src/hyperspell/types/memory_list_params.py">params</a>) -> <a href="./src/hyperspell/types/memory.py">SyncCursorPage[Memory]</a></code>
48+
- <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>
49+
- <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>
5050
- <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>
5151
- <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>
52-
- <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/document_status.py">DocumentStatus</a></code>
52+
- <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>
5353

5454
# Vaults
5555

src/hyperspell/resources/memories.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
)
2222
from ..pagination import SyncCursorPage, AsyncCursorPage
2323
from .._base_client import AsyncPaginator, make_request_options
24-
from ..types.document import Document
25-
from ..types.document_status import DocumentStatus
24+
from ..types.memory import Memory
25+
from ..types.memory_status import MemoryStatus
2626
from ..types.memory_search_response import MemorySearchResponse
2727
from ..types.memory_status_response import MemoryStatusResponse
2828

@@ -112,7 +112,7 @@ def list(
112112
extra_query: Query | None = None,
113113
extra_body: Body | None = None,
114114
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
115-
) -> SyncCursorPage[Document]:
115+
) -> SyncCursorPage[Memory]:
116116
"""This endpoint allows you to paginate through all documents in the index.
117117
118118
You can
@@ -133,7 +133,7 @@ def list(
133133
"""
134134
return self._get_api_list(
135135
"/memories/list",
136-
page=SyncCursorPage[Document],
136+
page=SyncCursorPage[Memory],
137137
options=make_request_options(
138138
extra_headers=extra_headers,
139139
extra_query=extra_query,
@@ -149,7 +149,7 @@ def list(
149149
memory_list_params.MemoryListParams,
150150
),
151151
),
152-
model=Document,
152+
model=Memory,
153153
)
154154

155155
def add(
@@ -166,7 +166,7 @@ def add(
166166
extra_query: Query | None = None,
167167
extra_body: Body | None = None,
168168
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
169-
) -> DocumentStatus:
169+
) -> MemoryStatus:
170170
"""Adds an arbitrary document to the index.
171171
172172
This can be any text, email, call
@@ -211,7 +211,7 @@ def add(
211211
options=make_request_options(
212212
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
213213
),
214-
cast_to=DocumentStatus,
214+
cast_to=MemoryStatus,
215215
)
216216

217217
def get(
@@ -272,7 +272,7 @@ def get(
272272
extra_query: Query | None = None,
273273
extra_body: Body | None = None,
274274
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
275-
) -> Document:
275+
) -> Memory:
276276
"""
277277
Retrieves a document by provider and resource_id.
278278
@@ -294,7 +294,7 @@ def get(
294294
options=make_request_options(
295295
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
296296
),
297-
cast_to=Document,
297+
cast_to=Memory,
298298
)
299299

300300
def search(
@@ -439,7 +439,7 @@ def upload(
439439
extra_query: Query | None = None,
440440
extra_body: Body | None = None,
441441
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
442-
) -> DocumentStatus:
442+
) -> MemoryStatus:
443443
"""This endpoint will upload a file to the index and return a document ID.
444444
445445
The file
@@ -478,7 +478,7 @@ def upload(
478478
options=make_request_options(
479479
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
480480
),
481-
cast_to=DocumentStatus,
481+
cast_to=MemoryStatus,
482482
)
483483

484484

@@ -565,7 +565,7 @@ def list(
565565
extra_query: Query | None = None,
566566
extra_body: Body | None = None,
567567
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
568-
) -> AsyncPaginator[Document, AsyncCursorPage[Document]]:
568+
) -> AsyncPaginator[Memory, AsyncCursorPage[Memory]]:
569569
"""This endpoint allows you to paginate through all documents in the index.
570570
571571
You can
@@ -586,7 +586,7 @@ def list(
586586
"""
587587
return self._get_api_list(
588588
"/memories/list",
589-
page=AsyncCursorPage[Document],
589+
page=AsyncCursorPage[Memory],
590590
options=make_request_options(
591591
extra_headers=extra_headers,
592592
extra_query=extra_query,
@@ -602,7 +602,7 @@ def list(
602602
memory_list_params.MemoryListParams,
603603
),
604604
),
605-
model=Document,
605+
model=Memory,
606606
)
607607

608608
async def add(
@@ -619,7 +619,7 @@ async def add(
619619
extra_query: Query | None = None,
620620
extra_body: Body | None = None,
621621
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
622-
) -> DocumentStatus:
622+
) -> MemoryStatus:
623623
"""Adds an arbitrary document to the index.
624624
625625
This can be any text, email, call
@@ -664,7 +664,7 @@ async def add(
664664
options=make_request_options(
665665
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
666666
),
667-
cast_to=DocumentStatus,
667+
cast_to=MemoryStatus,
668668
)
669669

670670
async def get(
@@ -725,7 +725,7 @@ async def get(
725725
extra_query: Query | None = None,
726726
extra_body: Body | None = None,
727727
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
728-
) -> Document:
728+
) -> Memory:
729729
"""
730730
Retrieves a document by provider and resource_id.
731731
@@ -747,7 +747,7 @@ async def get(
747747
options=make_request_options(
748748
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
749749
),
750-
cast_to=Document,
750+
cast_to=Memory,
751751
)
752752

753753
async def search(
@@ -892,7 +892,7 @@ async def upload(
892892
extra_query: Query | None = None,
893893
extra_body: Body | None = None,
894894
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
895-
) -> DocumentStatus:
895+
) -> MemoryStatus:
896896
"""This endpoint will upload a file to the index and return a document ID.
897897
898898
The file
@@ -931,7 +931,7 @@ async def upload(
931931
options=make_request_options(
932932
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
933933
),
934-
cast_to=DocumentStatus,
934+
cast_to=MemoryStatus,
935935
)
936936

937937

src/hyperspell/types/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
from __future__ import annotations
44

55
from .token import Token as Token
6-
from .document import Document as Document
7-
from .document_status import DocumentStatus as DocumentStatus
6+
from .memory import Memory as Memory
7+
from .memory_status import MemoryStatus as MemoryStatus
88
from .auth_me_response import AuthMeResponse as AuthMeResponse
99
from .memory_add_params import MemoryAddParams as MemoryAddParams
1010
from .vault_list_params import VaultListParams as VaultListParams
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from .._models import BaseModel
88

9-
__all__ = ["Document", "Metadata", "MetadataEvent"]
9+
__all__ = ["Memory", "Metadata", "MetadataEvent"]
1010

1111

1212
class MetadataEvent(BaseModel):
@@ -33,7 +33,7 @@ class Metadata(BaseModel):
3333
def __getattr__(self, attr: str) -> object: ...
3434

3535

36-
class Document(BaseModel):
36+
class Memory(BaseModel):
3737
resource_id: str
3838

3939
source: Literal[

src/hyperspell/types/memory_search_response.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
from typing import Dict, List, Optional
44

5+
from .memory import Memory
56
from .._models import BaseModel
6-
from .document import Document
77

88
__all__ = ["MemorySearchResponse"]
99

1010

1111
class MemorySearchResponse(BaseModel):
12-
documents: List[Document]
12+
documents: List[Memory]
1313

1414
answer: Optional[str] = None
1515
"""The answer to the query, if the request was set to answer."""
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
from .._models import BaseModel
66

7-
__all__ = ["DocumentStatus"]
7+
__all__ = ["MemoryStatus"]
88

99

10-
class DocumentStatus(BaseModel):
10+
class MemoryStatus(BaseModel):
1111
id: int
1212
"""Deprecated: refer to documents by source and resource_id instead"""
1313

0 commit comments

Comments
 (0)