Skip to content

Commit e349d69

Browse files
feat(api): api update (#83)
1 parent 2a12261 commit e349d69

File tree

6 files changed

+13
-71
lines changed

6 files changed

+13
-71
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 10
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hyperspell%2Fhyperspell-d62cfe4e19e8a06c749d20be62ec4d5157be6c1fdbcc1b1daeed7ff74b614eca.yml
3-
openapi_spec_hash: 5442c5ecdba83ac40efaaedaf9a1cd65
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hyperspell%2Fhyperspell-22761e18c9e84e2bc357771cca49e85f66b8d6b76c7f6e682effe2501ea3cf2e.yml
3+
openapi_spec_hash: b467d9287bf9504412b7252da9e46fb7
44
config_hash: 63e7969fd7c560b6105e1de79148b568

api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Methods:
1111
- <code title="get /documents/list">client.documents.<a href="./src/hyperspell/resources/documents.py">list</a>(\*\*<a href="src/hyperspell/types/document_list_params.py">params</a>) -> <a href="./src/hyperspell/types/document_list_response.py">SyncCursorPage[DocumentListResponse]</a></code>
1212
- <code title="post /documents/add">client.documents.<a href="./src/hyperspell/resources/documents.py">add</a>(\*\*<a href="src/hyperspell/types/document_add_params.py">params</a>) -> <a href="./src/hyperspell/types/document_status.py">DocumentStatus</a></code>
1313
- <code title="post /documents/scrape">client.documents.<a href="./src/hyperspell/resources/documents.py">add_url</a>(\*\*<a href="src/hyperspell/types/document_add_url_params.py">params</a>) -> <a href="./src/hyperspell/types/document_status.py">DocumentStatus</a></code>
14-
- <code title="get /documents/get/{document_id}">client.documents.<a href="./src/hyperspell/resources/documents.py">get</a>(document_id) -> <a href="./src/hyperspell/types/document_get_response.py">DocumentGetResponse</a></code>
14+
- <code title="get /documents/get/{document_id}">client.documents.<a href="./src/hyperspell/resources/documents.py">get</a>(document_id) -> <a href="./src/hyperspell/types/document_get_response.py">object</a></code>
1515
- <code title="post /documents/upload">client.documents.<a href="./src/hyperspell/resources/documents.py">upload</a>(\*\*<a href="src/hyperspell/types/document_upload_params.py">params</a>) -> <a href="./src/hyperspell/types/document_status.py">DocumentStatus</a></code>
1616

1717
# Collections

src/hyperspell/resources/documents.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
from ..pagination import SyncCursorPage, AsyncCursorPage
3232
from .._base_client import AsyncPaginator, make_request_options
3333
from ..types.document_status import DocumentStatus
34-
from ..types.document_get_response import DocumentGetResponse
3534
from ..types.document_list_response import DocumentListResponse
3635

3736
__all__ = ["DocumentsResource", "AsyncDocumentsResource"]
@@ -221,7 +220,7 @@ def get(
221220
extra_query: Query | None = None,
222221
extra_body: Body | None = None,
223222
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
224-
) -> DocumentGetResponse:
223+
) -> object:
225224
"""
226225
Retrieves a document by ID, including its collection name and sections.
227226
@@ -239,7 +238,7 @@ def get(
239238
options=make_request_options(
240239
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
241240
),
242-
cast_to=DocumentGetResponse,
241+
cast_to=object,
243242
)
244243

245244
def upload(
@@ -480,7 +479,7 @@ async def get(
480479
extra_query: Query | None = None,
481480
extra_body: Body | None = None,
482481
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
483-
) -> DocumentGetResponse:
482+
) -> object:
484483
"""
485484
Retrieves a document by ID, including its collection name and sections.
486485
@@ -498,7 +497,7 @@ async def get(
498497
options=make_request_options(
499498
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
500499
),
501-
cast_to=DocumentGetResponse,
500+
cast_to=object,
502501
)
503502

504503
async def upload(

src/hyperspell/types/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from .document_add_params import DocumentAddParams as DocumentAddParams
99
from .query_search_params import QuerySearchParams as QuerySearchParams
1010
from .document_list_params import DocumentListParams as DocumentListParams
11-
from .document_get_response import DocumentGetResponse as DocumentGetResponse
1211
from .query_search_response import QuerySearchResponse as QuerySearchResponse
1312
from .auth_user_token_params import AuthUserTokenParams as AuthUserTokenParams
1413
from .collection_list_params import CollectionListParams as CollectionListParams

src/hyperspell/types/document_get_response.py

Lines changed: 0 additions & 55 deletions
This file was deleted.

tests/api_resources/test_documents.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from tests.utils import assert_matches_type
1212
from hyperspell.types import (
1313
DocumentStatus,
14-
DocumentGetResponse,
1514
DocumentListResponse,
1615
)
1716
from hyperspell._utils import parse_datetime
@@ -142,7 +141,7 @@ def test_method_get(self, client: Hyperspell) -> None:
142141
document = client.documents.get(
143142
0,
144143
)
145-
assert_matches_type(DocumentGetResponse, document, path=["response"])
144+
assert_matches_type(object, document, path=["response"])
146145

147146
@parametrize
148147
def test_raw_response_get(self, client: Hyperspell) -> None:
@@ -153,7 +152,7 @@ def test_raw_response_get(self, client: Hyperspell) -> None:
153152
assert response.is_closed is True
154153
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
155154
document = response.parse()
156-
assert_matches_type(DocumentGetResponse, document, path=["response"])
155+
assert_matches_type(object, document, path=["response"])
157156

158157
@parametrize
159158
def test_streaming_response_get(self, client: Hyperspell) -> None:
@@ -164,7 +163,7 @@ def test_streaming_response_get(self, client: Hyperspell) -> None:
164163
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
165164

166165
document = response.parse()
167-
assert_matches_type(DocumentGetResponse, document, path=["response"])
166+
assert_matches_type(object, document, path=["response"])
168167

169168
assert cast(Any, response.is_closed) is True
170169

@@ -325,7 +324,7 @@ async def test_method_get(self, async_client: AsyncHyperspell) -> None:
325324
document = await async_client.documents.get(
326325
0,
327326
)
328-
assert_matches_type(DocumentGetResponse, document, path=["response"])
327+
assert_matches_type(object, document, path=["response"])
329328

330329
@parametrize
331330
async def test_raw_response_get(self, async_client: AsyncHyperspell) -> None:
@@ -336,7 +335,7 @@ async def test_raw_response_get(self, async_client: AsyncHyperspell) -> None:
336335
assert response.is_closed is True
337336
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
338337
document = await response.parse()
339-
assert_matches_type(DocumentGetResponse, document, path=["response"])
338+
assert_matches_type(object, document, path=["response"])
340339

341340
@parametrize
342341
async def test_streaming_response_get(self, async_client: AsyncHyperspell) -> None:
@@ -347,7 +346,7 @@ async def test_streaming_response_get(self, async_client: AsyncHyperspell) -> No
347346
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
348347

349348
document = await response.parse()
350-
assert_matches_type(DocumentGetResponse, document, path=["response"])
349+
assert_matches_type(object, document, path=["response"])
351350

352351
assert cast(Any, response.is_closed) is True
353352

0 commit comments

Comments
 (0)