Skip to content

Commit 4186943

Browse files
docs: update examples
1 parent 32dab0e commit 4186943

File tree

5 files changed

+44
-28
lines changed

5 files changed

+44
-28
lines changed

tests/api_resources/classifications/test_universal.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ def test_method_create_with_all_params(self, client: Isaacus) -> None:
3838
scoring_method="auto",
3939
chunking_options={
4040
"size": 512,
41-
"overlap_ratio": 0.1,
42-
"overlap_tokens": 10,
41+
"overlap_ratio": None,
42+
"overlap_tokens": None,
4343
},
4444
)
4545
assert_matches_type(UniversalClassificationResponse, universal, path=["response"])
@@ -101,8 +101,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncIsaacus) -
101101
scoring_method="auto",
102102
chunking_options={
103103
"size": 512,
104-
"overlap_ratio": 0.1,
105-
"overlap_tokens": 10,
104+
"overlap_ratio": None,
105+
"overlap_tokens": None,
106106
},
107107
)
108108
assert_matches_type(UniversalClassificationResponse, universal, path=["response"])

tests/api_resources/extractions/test_qa.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ def test_method_create_with_all_params(self, client: Isaacus) -> None:
4141
ignore_inextractability=False,
4242
top_k=1,
4343
chunking_options={
44-
"size": 512,
45-
"overlap_ratio": 0.1,
46-
"overlap_tokens": 10,
44+
"size": None,
45+
"overlap_ratio": None,
46+
"overlap_tokens": None,
4747
},
4848
)
4949
assert_matches_type(AnswerExtractionResponse, qa, path=["response"])
@@ -112,9 +112,9 @@ async def test_method_create_with_all_params(self, async_client: AsyncIsaacus) -
112112
ignore_inextractability=False,
113113
top_k=1,
114114
chunking_options={
115-
"size": 512,
116-
"overlap_ratio": 0.1,
117-
"overlap_tokens": 10,
115+
"size": None,
116+
"overlap_ratio": None,
117+
"overlap_tokens": None,
118118
},
119119
)
120120
assert_matches_type(AnswerExtractionResponse, qa, path=["response"])

tests/api_resources/test_embeddings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def test_method_create_with_all_params(self, client: Isaacus) -> None:
3434
texts=["Are restraints of trade enforceable under English law?", "What is a non-compete clause?"],
3535
task="retrieval/query",
3636
overflow_strategy="drop_end",
37-
dimensions=1,
37+
dimensions=1792,
3838
)
3939
assert_matches_type(EmbeddingResponse, embedding, path=["response"])
4040

@@ -89,7 +89,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncIsaacus) -
8989
texts=["Are restraints of trade enforceable under English law?", "What is a non-compete clause?"],
9090
task="retrieval/query",
9191
overflow_strategy="drop_end",
92-
dimensions=1,
92+
dimensions=1792,
9393
)
9494
assert_matches_type(EmbeddingResponse, embedding, path=["response"])
9595

tests/api_resources/test_enrichments.py

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ class TestEnrichments:
2222
def test_method_create(self, client: Isaacus) -> None:
2323
enrichment = client.enrichments.create(
2424
model="kanon-2-enricher",
25-
texts=['1.5 You (the "User") agree to be bound by these Terms.'],
25+
texts=[
26+
'[42] The U.S. Attorney General, Mr. McGill, argued at ¶ 21 of the Filing that "§ 206 of Title 29 of the U.S. Code (the "Labor Title") does not apply to the plaintiff, Ms. Moody, given the definition of an "employee" at §203(e)(4) of the Labor Title does not include volunteers, and, regardless, she lives in Austria."'
27+
],
2628
)
2729
assert_matches_type(EnrichmentResponse, enrichment, path=["response"])
2830

@@ -31,7 +33,9 @@ def test_method_create(self, client: Isaacus) -> None:
3133
def test_method_create_with_all_params(self, client: Isaacus) -> None:
3234
enrichment = client.enrichments.create(
3335
model="kanon-2-enricher",
34-
texts=['1.5 You (the "User") agree to be bound by these Terms.'],
36+
texts=[
37+
'[42] The U.S. Attorney General, Mr. McGill, argued at ¶ 21 of the Filing that "§ 206 of Title 29 of the U.S. Code (the "Labor Title") does not apply to the plaintiff, Ms. Moody, given the definition of an "employee" at §203(e)(4) of the Labor Title does not include volunteers, and, regardless, she lives in Austria."'
38+
],
3539
overflow_strategy="auto",
3640
)
3741
assert_matches_type(EnrichmentResponse, enrichment, path=["response"])
@@ -41,7 +45,9 @@ def test_method_create_with_all_params(self, client: Isaacus) -> None:
4145
def test_raw_response_create(self, client: Isaacus) -> None:
4246
response = client.enrichments.with_raw_response.create(
4347
model="kanon-2-enricher",
44-
texts=['1.5 You (the "User") agree to be bound by these Terms.'],
48+
texts=[
49+
'[42] The U.S. Attorney General, Mr. McGill, argued at ¶ 21 of the Filing that "§ 206 of Title 29 of the U.S. Code (the "Labor Title") does not apply to the plaintiff, Ms. Moody, given the definition of an "employee" at §203(e)(4) of the Labor Title does not include volunteers, and, regardless, she lives in Austria."'
50+
],
4551
)
4652

4753
assert response.is_closed is True
@@ -54,7 +60,9 @@ def test_raw_response_create(self, client: Isaacus) -> None:
5460
def test_streaming_response_create(self, client: Isaacus) -> None:
5561
with client.enrichments.with_streaming_response.create(
5662
model="kanon-2-enricher",
57-
texts=['1.5 You (the "User") agree to be bound by these Terms.'],
63+
texts=[
64+
'[42] The U.S. Attorney General, Mr. McGill, argued at ¶ 21 of the Filing that "§ 206 of Title 29 of the U.S. Code (the "Labor Title") does not apply to the plaintiff, Ms. Moody, given the definition of an "employee" at §203(e)(4) of the Labor Title does not include volunteers, and, regardless, she lives in Austria."'
65+
],
5866
) as response:
5967
assert not response.is_closed
6068
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -75,7 +83,9 @@ class TestAsyncEnrichments:
7583
async def test_method_create(self, async_client: AsyncIsaacus) -> None:
7684
enrichment = await async_client.enrichments.create(
7785
model="kanon-2-enricher",
78-
texts=['1.5 You (the "User") agree to be bound by these Terms.'],
86+
texts=[
87+
'[42] The U.S. Attorney General, Mr. McGill, argued at ¶ 21 of the Filing that "§ 206 of Title 29 of the U.S. Code (the "Labor Title") does not apply to the plaintiff, Ms. Moody, given the definition of an "employee" at §203(e)(4) of the Labor Title does not include volunteers, and, regardless, she lives in Austria."'
88+
],
7989
)
8090
assert_matches_type(EnrichmentResponse, enrichment, path=["response"])
8191

@@ -84,7 +94,9 @@ async def test_method_create(self, async_client: AsyncIsaacus) -> None:
8494
async def test_method_create_with_all_params(self, async_client: AsyncIsaacus) -> None:
8595
enrichment = await async_client.enrichments.create(
8696
model="kanon-2-enricher",
87-
texts=['1.5 You (the "User") agree to be bound by these Terms.'],
97+
texts=[
98+
'[42] The U.S. Attorney General, Mr. McGill, argued at ¶ 21 of the Filing that "§ 206 of Title 29 of the U.S. Code (the "Labor Title") does not apply to the plaintiff, Ms. Moody, given the definition of an "employee" at §203(e)(4) of the Labor Title does not include volunteers, and, regardless, she lives in Austria."'
99+
],
88100
overflow_strategy="auto",
89101
)
90102
assert_matches_type(EnrichmentResponse, enrichment, path=["response"])
@@ -94,7 +106,9 @@ async def test_method_create_with_all_params(self, async_client: AsyncIsaacus) -
94106
async def test_raw_response_create(self, async_client: AsyncIsaacus) -> None:
95107
response = await async_client.enrichments.with_raw_response.create(
96108
model="kanon-2-enricher",
97-
texts=['1.5 You (the "User") agree to be bound by these Terms.'],
109+
texts=[
110+
'[42] The U.S. Attorney General, Mr. McGill, argued at ¶ 21 of the Filing that "§ 206 of Title 29 of the U.S. Code (the "Labor Title") does not apply to the plaintiff, Ms. Moody, given the definition of an "employee" at §203(e)(4) of the Labor Title does not include volunteers, and, regardless, she lives in Austria."'
111+
],
98112
)
99113

100114
assert response.is_closed is True
@@ -107,7 +121,9 @@ async def test_raw_response_create(self, async_client: AsyncIsaacus) -> None:
107121
async def test_streaming_response_create(self, async_client: AsyncIsaacus) -> None:
108122
async with async_client.enrichments.with_streaming_response.create(
109123
model="kanon-2-enricher",
110-
texts=['1.5 You (the "User") agree to be bound by these Terms.'],
124+
texts=[
125+
'[42] The U.S. Attorney General, Mr. McGill, argued at ¶ 21 of the Filing that "§ 206 of Title 29 of the U.S. Code (the "Labor Title") does not apply to the plaintiff, Ms. Moody, given the definition of an "employee" at §203(e)(4) of the Labor Title does not include volunteers, and, regardless, she lives in Austria."'
126+
],
111127
) as response:
112128
assert not response.is_closed
113129
assert response.http_request.headers.get("X-Stainless-Lang") == "python"

tests/api_resources/test_rerankings.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ def test_method_create_with_all_params(self, client: Isaacus) -> None:
4646
"Negligence in tort law requires establishing a duty of care that the defendant owed to the plaintiff.",
4747
"The concept of negligence is central to tort law, with courts assessing whether a breach of duty caused harm.",
4848
],
49-
top_n=1,
49+
top_n=None,
5050
is_iql=False,
5151
scoring_method="auto",
5252
chunking_options={
53-
"size": 512,
54-
"overlap_ratio": 0.1,
55-
"overlap_tokens": 10,
53+
"size": None,
54+
"overlap_ratio": None,
55+
"overlap_tokens": None,
5656
},
5757
)
5858
assert_matches_type(RerankingResponse, reranking, path=["response"])
@@ -134,13 +134,13 @@ async def test_method_create_with_all_params(self, async_client: AsyncIsaacus) -
134134
"Negligence in tort law requires establishing a duty of care that the defendant owed to the plaintiff.",
135135
"The concept of negligence is central to tort law, with courts assessing whether a breach of duty caused harm.",
136136
],
137-
top_n=1,
137+
top_n=None,
138138
is_iql=False,
139139
scoring_method="auto",
140140
chunking_options={
141-
"size": 512,
142-
"overlap_ratio": 0.1,
143-
"overlap_tokens": 10,
141+
"size": None,
142+
"overlap_ratio": None,
143+
"overlap_tokens": None,
144144
},
145145
)
146146
assert_matches_type(RerankingResponse, reranking, path=["response"])

0 commit comments

Comments
 (0)