Skip to content

Commit 7c8ccc6

Browse files
feat(api): api update (#43)
1 parent 2aaad04 commit 7c8ccc6

File tree

4 files changed

+11
-28
lines changed

4 files changed

+11
-28
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 10
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hyperspell%2Fhyperspell-7632a025f14cf4ef9630966e00cb47fd93e8b43f1e9111f3917eb5adf145f0dd.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hyperspell%2Fhyperspell-ba6c4db7ea12bd505fe5cfe650ef7372c17dbe083875afea40d5de959dbba9e1.yml

src/hyperspell/resources/documents.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def add_url(
189189
self,
190190
*,
191191
collection: str,
192-
url: Optional[str] | NotGiven = NOT_GIVEN,
192+
url: str,
193193
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
194194
# The extra values given here take precedence over values defined on the client or passed to this method.
195195
extra_headers: Headers | None = None,
@@ -207,8 +207,7 @@ def add_url(
207207
collection: Name of the collection to add the document to. If the collection does not exist,
208208
it will be created.
209209
210-
url: Source URL of the document. If text is not provided and URL is publicly
211-
accessible, Hyperspell will retrieve the document from this URL.
210+
url: Source URL of the document.
212211
213212
extra_headers: Send extra headers
214213
@@ -465,7 +464,7 @@ async def add_url(
465464
self,
466465
*,
467466
collection: str,
468-
url: Optional[str] | NotGiven = NOT_GIVEN,
467+
url: str,
469468
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
470469
# The extra values given here take precedence over values defined on the client or passed to this method.
471470
extra_headers: Headers | None = None,
@@ -483,8 +482,7 @@ async def add_url(
483482
collection: Name of the collection to add the document to. If the collection does not exist,
484483
it will be created.
485484
486-
url: Source URL of the document. If text is not provided and URL is publicly
487-
accessible, Hyperspell will retrieve the document from this URL.
485+
url: Source URL of the document.
488486
489487
extra_headers: Send extra headers
490488

src/hyperspell/types/document_add_url_params.py

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

33
from __future__ import annotations
44

5-
from typing import Optional
65
from typing_extensions import Required, TypedDict
76

87
__all__ = ["DocumentAddURLParams"]
@@ -15,9 +14,5 @@ class DocumentAddURLParams(TypedDict, total=False):
1514
If the collection does not exist, it will be created.
1615
"""
1716

18-
url: Optional[str]
19-
"""Source URL of the document.
20-
21-
If text is not provided and URL is publicly accessible, Hyperspell will retrieve
22-
the document from this URL.
23-
"""
17+
url: Required[str]
18+
"""Source URL of the document."""

tests/api_resources/test_documents.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,6 @@ def test_streaming_response_add(self, client: Hyperspell) -> None:
110110

111111
@parametrize
112112
def test_method_add_url(self, client: Hyperspell) -> None:
113-
document = client.documents.add_url(
114-
collection="collection",
115-
)
116-
assert_matches_type(DocumentStatus, document, path=["response"])
117-
118-
@parametrize
119-
def test_method_add_url_with_all_params(self, client: Hyperspell) -> None:
120113
document = client.documents.add_url(
121114
collection="collection",
122115
url="url",
@@ -127,6 +120,7 @@ def test_method_add_url_with_all_params(self, client: Hyperspell) -> None:
127120
def test_raw_response_add_url(self, client: Hyperspell) -> None:
128121
response = client.documents.with_raw_response.add_url(
129122
collection="collection",
123+
url="url",
130124
)
131125

132126
assert response.is_closed is True
@@ -138,6 +132,7 @@ def test_raw_response_add_url(self, client: Hyperspell) -> None:
138132
def test_streaming_response_add_url(self, client: Hyperspell) -> None:
139133
with client.documents.with_streaming_response.add_url(
140134
collection="collection",
135+
url="url",
141136
) as response:
142137
assert not response.is_closed
143138
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -303,13 +298,6 @@ async def test_streaming_response_add(self, async_client: AsyncHyperspell) -> No
303298

304299
@parametrize
305300
async def test_method_add_url(self, async_client: AsyncHyperspell) -> None:
306-
document = await async_client.documents.add_url(
307-
collection="collection",
308-
)
309-
assert_matches_type(DocumentStatus, document, path=["response"])
310-
311-
@parametrize
312-
async def test_method_add_url_with_all_params(self, async_client: AsyncHyperspell) -> None:
313301
document = await async_client.documents.add_url(
314302
collection="collection",
315303
url="url",
@@ -320,6 +308,7 @@ async def test_method_add_url_with_all_params(self, async_client: AsyncHyperspel
320308
async def test_raw_response_add_url(self, async_client: AsyncHyperspell) -> None:
321309
response = await async_client.documents.with_raw_response.add_url(
322310
collection="collection",
311+
url="url",
323312
)
324313

325314
assert response.is_closed is True
@@ -331,6 +320,7 @@ async def test_raw_response_add_url(self, async_client: AsyncHyperspell) -> None
331320
async def test_streaming_response_add_url(self, async_client: AsyncHyperspell) -> None:
332321
async with async_client.documents.with_streaming_response.add_url(
333322
collection="collection",
323+
url="url",
334324
) as response:
335325
assert not response.is_closed
336326
assert response.http_request.headers.get("X-Stainless-Lang") == "python"

0 commit comments

Comments
 (0)