Skip to content

Commit 54053fb

Browse files
committed
feat(api): update via SDK Studio
1 parent 7fe5a36 commit 54053fb

6 files changed

Lines changed: 21 additions & 24 deletions

File tree

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 1
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/bespoke-labs%2Fbespokelabs-b32b2124b6a1dbe8f7a47944e632c958a0bd1d2554562f4c5f81a2e68ad5b3e8.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/bespoke-labs%2Fbespokelabs-f48df56bde812339da2d89b563f6bc1cc2d281cbbf4c9420ce9d9d0d405e989e.yml

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ client = BespokeLabs(
3737

3838
factcheck_create_response = client.factcheck.create(
3939
claim="claim",
40+
context="context",
4041
)
4142
print(factcheck_create_response.support_prob)
4243
```
@@ -64,6 +65,7 @@ client = AsyncBespokeLabs(
6465
async def main() -> None:
6566
factcheck_create_response = await client.factcheck.create(
6667
claim="claim",
68+
context="context",
6769
)
6870
print(factcheck_create_response.support_prob)
6971

@@ -100,6 +102,7 @@ client = BespokeLabs()
100102
try:
101103
client.factcheck.create(
102104
claim="claim",
105+
context="context",
103106
)
104107
except bespokelabs.APIConnectionError as e:
105108
print("The server could not be reached")
@@ -145,6 +148,7 @@ client = BespokeLabs(
145148
# Or, configure per-request:
146149
client.with_options(max_retries=5).factcheck.create(
147150
claim="claim",
151+
context="context",
148152
)
149153
```
150154

@@ -170,6 +174,7 @@ client = BespokeLabs(
170174
# Override per-request:
171175
client.with_options(timeout=5.0).factcheck.create(
172176
claim="claim",
177+
context="context",
173178
)
174179
```
175180

@@ -211,6 +216,7 @@ from bespokelabs import BespokeLabs
211216
client = BespokeLabs()
212217
response = client.factcheck.with_raw_response.create(
213218
claim="claim",
219+
context="context",
214220
)
215221
print(response.headers.get('X-My-Header'))
216222

@@ -231,6 +237,7 @@ To stream the response body, use `.with_streaming_response` instead, which requi
231237
```python
232238
with client.factcheck.with_streaming_response.create(
233239
claim="claim",
240+
context="context",
234241
) as response:
235242
print(response.headers.get("X-My-Header"))
236243

src/bespokelabs/resources/factcheck.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def create(
3737
self,
3838
*,
3939
claim: str,
40-
context: str | NotGiven = NOT_GIVEN,
40+
context: str,
4141
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
4242
# The extra values given here take precedence over values defined on the client or passed to this method.
4343
extra_headers: Headers | None = None,
@@ -88,7 +88,7 @@ async def create(
8888
self,
8989
*,
9090
claim: str,
91-
context: str | NotGiven = NOT_GIVEN,
91+
context: str,
9292
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
9393
# The extra values given here take precedence over values defined on the client or passed to this method.
9494
extra_headers: Headers | None = None,

src/bespokelabs/types/factcheck_create_params.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ class FactcheckCreateParams(TypedDict, total=False):
1111
claim: Required[str]
1212
"""The claim to be fact-checked."""
1313

14-
context: str
14+
context: Required[str]

tests/api_resources/test_factcheck.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,6 @@ class TestFactcheck:
1919

2020
@parametrize
2121
def test_method_create(self, client: BespokeLabs) -> None:
22-
factcheck = client.factcheck.create(
23-
claim="claim",
24-
)
25-
assert_matches_type(FactcheckCreateResponse, factcheck, path=["response"])
26-
27-
@parametrize
28-
def test_method_create_with_all_params(self, client: BespokeLabs) -> None:
2922
factcheck = client.factcheck.create(
3023
claim="claim",
3124
context="context",
@@ -36,6 +29,7 @@ def test_method_create_with_all_params(self, client: BespokeLabs) -> None:
3629
def test_raw_response_create(self, client: BespokeLabs) -> None:
3730
response = client.factcheck.with_raw_response.create(
3831
claim="claim",
32+
context="context",
3933
)
4034

4135
assert response.is_closed is True
@@ -47,6 +41,7 @@ def test_raw_response_create(self, client: BespokeLabs) -> None:
4741
def test_streaming_response_create(self, client: BespokeLabs) -> None:
4842
with client.factcheck.with_streaming_response.create(
4943
claim="claim",
44+
context="context",
5045
) as response:
5146
assert not response.is_closed
5247
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -62,13 +57,6 @@ class TestAsyncFactcheck:
6257

6358
@parametrize
6459
async def test_method_create(self, async_client: AsyncBespokeLabs) -> None:
65-
factcheck = await async_client.factcheck.create(
66-
claim="claim",
67-
)
68-
assert_matches_type(FactcheckCreateResponse, factcheck, path=["response"])
69-
70-
@parametrize
71-
async def test_method_create_with_all_params(self, async_client: AsyncBespokeLabs) -> None:
7260
factcheck = await async_client.factcheck.create(
7361
claim="claim",
7462
context="context",
@@ -79,6 +67,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncBespokeLab
7967
async def test_raw_response_create(self, async_client: AsyncBespokeLabs) -> None:
8068
response = await async_client.factcheck.with_raw_response.create(
8169
claim="claim",
70+
context="context",
8271
)
8372

8473
assert response.is_closed is True
@@ -90,6 +79,7 @@ async def test_raw_response_create(self, async_client: AsyncBespokeLabs) -> None
9079
async def test_streaming_response_create(self, async_client: AsyncBespokeLabs) -> None:
9180
async with async_client.factcheck.with_streaming_response.create(
9281
claim="claim",
82+
context="context",
9383
) as response:
9484
assert not response.is_closed
9585
assert response.http_request.headers.get("X-Stainless-Lang") == "python"

tests/test_client.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> No
724724
with pytest.raises(APITimeoutError):
725725
self.client.post(
726726
"/v0/factcheck",
727-
body=cast(object, dict(claim="claim")),
727+
body=cast(object, dict(claim="claim", context="context")),
728728
cast_to=httpx.Response,
729729
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
730730
)
@@ -739,7 +739,7 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> Non
739739
with pytest.raises(APIStatusError):
740740
self.client.post(
741741
"/v0/factcheck",
742-
body=cast(object, dict(claim="claim")),
742+
body=cast(object, dict(claim="claim", context="context")),
743743
cast_to=httpx.Response,
744744
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
745745
)
@@ -763,7 +763,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
763763

764764
respx_mock.post("/v0/factcheck").mock(side_effect=retry_handler)
765765

766-
response = client.factcheck.with_raw_response.create(claim="claim")
766+
response = client.factcheck.with_raw_response.create(claim="claim", context="context")
767767

768768
assert response.retries_taken == failures_before_success
769769

@@ -1446,7 +1446,7 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter)
14461446
with pytest.raises(APITimeoutError):
14471447
await self.client.post(
14481448
"/v0/factcheck",
1449-
body=cast(object, dict(claim="claim")),
1449+
body=cast(object, dict(claim="claim", context="context")),
14501450
cast_to=httpx.Response,
14511451
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
14521452
)
@@ -1461,7 +1461,7 @@ async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter)
14611461
with pytest.raises(APIStatusError):
14621462
await self.client.post(
14631463
"/v0/factcheck",
1464-
body=cast(object, dict(claim="claim")),
1464+
body=cast(object, dict(claim="claim", context="context")),
14651465
cast_to=httpx.Response,
14661466
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
14671467
)
@@ -1488,6 +1488,6 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
14881488

14891489
respx_mock.post("/v0/factcheck").mock(side_effect=retry_handler)
14901490

1491-
response = await client.factcheck.with_raw_response.create(claim="claim")
1491+
response = await client.factcheck.with_raw_response.create(claim="claim", context="context")
14921492

14931493
assert response.retries_taken == failures_before_success

0 commit comments

Comments
 (0)