Skip to content

Commit 5c7462d

Browse files
fix(sdk)!: add _response to response models to finally fix duplicated names
1 parent b838d18 commit 5c7462d

File tree

18 files changed

+96
-85
lines changed

18 files changed

+96
-85
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 4
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/isaacus%2Fisaacus-43557cfcc912900321433e1b633b39a81a3bfdbcfc86784aff4ff8219f5ebec4.yml
33
openapi_spec_hash: e612b47282935484c5de2ebbd49df824
4-
config_hash: 886b5eef0dbd90b8e6686e987a07b816
4+
config_hash: efa2ea406c5ecd6883ff8b0fb428e579

README.md

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

35-
universal_classification = client.classifications.universal.create(
35+
universal_classification_response = client.classifications.universal.create(
3636
model="kanon-universal-classifier",
3737
query="This is a confidentiality clause.",
3838
texts=["I agree not to tell anyone about the document."],
3939
)
40-
print(universal_classification.classifications)
40+
print(universal_classification_response.classifications)
4141
```
4242

4343
While you can provide an `api_key` keyword argument,
@@ -60,12 +60,12 @@ client = AsyncIsaacus(
6060

6161

6262
async def main() -> None:
63-
universal_classification = await client.classifications.universal.create(
63+
universal_classification_response = await client.classifications.universal.create(
6464
model="kanon-universal-classifier",
6565
query="This is a confidentiality clause.",
6666
texts=["I agree not to tell anyone about the document."],
6767
)
68-
print(universal_classification.classifications)
68+
print(universal_classification_response.classifications)
6969

7070

7171
asyncio.run(main())
@@ -97,12 +97,12 @@ async def main() -> None:
9797
api_key="My API Key",
9898
http_client=DefaultAioHttpClient(),
9999
) as client:
100-
universal_classification = await client.classifications.universal.create(
100+
universal_classification_response = await client.classifications.universal.create(
101101
model="kanon-universal-classifier",
102102
query="This is a confidentiality clause.",
103103
texts=["I agree not to tell anyone about the document."],
104104
)
105-
print(universal_classification.classifications)
105+
print(universal_classification_response.classifications)
106106

107107

108108
asyncio.run(main())
@@ -126,7 +126,7 @@ from isaacus import Isaacus
126126

127127
client = Isaacus()
128128

129-
universal_classification = client.classifications.universal.create(
129+
universal_classification_response = client.classifications.universal.create(
130130
model="kanon-universal-classifier",
131131
query="This is a confidentiality clause.",
132132
texts=["I agree not to tell anyone about the document."],
@@ -136,7 +136,7 @@ universal_classification = client.classifications.universal.create(
136136
"size": 512,
137137
},
138138
)
139-
print(universal_classification.classifications)
139+
print(universal_classification_response.classifications)
140140
```
141141

142142
## Handling errors

api.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
Types:
44

55
```python
6-
from isaacus.types import Embedding
6+
from isaacus.types import EmbeddingResponse
77
```
88

99
Methods:
1010

11-
- <code title="post /embeddings">client.embeddings.<a href="./src/isaacus/resources/embeddings.py">create</a>(\*\*<a href="src/isaacus/types/embedding_create_params.py">params</a>) -> <a href="./src/isaacus/types/embedding.py">Embedding</a></code>
11+
- <code title="post /embeddings">client.embeddings.<a href="./src/isaacus/resources/embeddings.py">create</a>(\*\*<a href="src/isaacus/types/embedding_create_params.py">params</a>) -> <a href="./src/isaacus/types/embedding_response.py">EmbeddingResponse</a></code>
1212

1313
# Classifications
1414

@@ -17,24 +17,24 @@ Methods:
1717
Types:
1818

1919
```python
20-
from isaacus.types.classifications import UniversalClassification
20+
from isaacus.types.classifications import UniversalClassificationResponse
2121
```
2222

2323
Methods:
2424

25-
- <code title="post /classifications/universal">client.classifications.universal.<a href="./src/isaacus/resources/classifications/universal.py">create</a>(\*\*<a href="src/isaacus/types/classifications/universal_create_params.py">params</a>) -> <a href="./src/isaacus/types/classifications/universal_classification.py">UniversalClassification</a></code>
25+
- <code title="post /classifications/universal">client.classifications.universal.<a href="./src/isaacus/resources/classifications/universal.py">create</a>(\*\*<a href="src/isaacus/types/classifications/universal_create_params.py">params</a>) -> <a href="./src/isaacus/types/classifications/universal_classification_response.py">UniversalClassificationResponse</a></code>
2626

2727
# Rerankings
2828

2929
Types:
3030

3131
```python
32-
from isaacus.types import Reranking
32+
from isaacus.types import RerankingResponse
3333
```
3434

3535
Methods:
3636

37-
- <code title="post /rerankings">client.rerankings.<a href="./src/isaacus/resources/rerankings.py">create</a>(\*\*<a href="src/isaacus/types/reranking_create_params.py">params</a>) -> <a href="./src/isaacus/types/reranking.py">Reranking</a></code>
37+
- <code title="post /rerankings">client.rerankings.<a href="./src/isaacus/resources/rerankings.py">create</a>(\*\*<a href="src/isaacus/types/reranking_create_params.py">params</a>) -> <a href="./src/isaacus/types/reranking_response.py">RerankingResponse</a></code>
3838

3939
# Extractions
4040

@@ -43,9 +43,9 @@ Methods:
4343
Types:
4444

4545
```python
46-
from isaacus.types.extractions import AnswerExtraction
46+
from isaacus.types.extractions import AnswerExtractionResponse
4747
```
4848

4949
Methods:
5050

51-
- <code title="post /extractions/qa">client.extractions.qa.<a href="./src/isaacus/resources/extractions/qa.py">create</a>(\*\*<a href="src/isaacus/types/extractions/qa_create_params.py">params</a>) -> <a href="./src/isaacus/types/extractions/answer_extraction.py">AnswerExtraction</a></code>
51+
- <code title="post /extractions/qa">client.extractions.qa.<a href="./src/isaacus/resources/extractions/qa.py">create</a>(\*\*<a href="src/isaacus/types/extractions/qa_create_params.py">params</a>) -> <a href="./src/isaacus/types/extractions/answer_extraction_response.py">AnswerExtractionResponse</a></code>

src/isaacus/resources/classifications/universal.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
)
2020
from ..._base_client import make_request_options
2121
from ...types.classifications import universal_create_params
22-
from ...types.classifications.universal_classification import UniversalClassification
22+
from ...types.classifications.universal_classification_response import UniversalClassificationResponse
2323

2424
__all__ = ["UniversalResource", "AsyncUniversalResource"]
2525

@@ -59,7 +59,7 @@ def create(
5959
extra_query: Query | None = None,
6060
extra_body: Body | None = None,
6161
timeout: float | httpx.Timeout | None | NotGiven = not_given,
62-
) -> UniversalClassification:
62+
) -> UniversalClassificationResponse:
6363
"""
6464
Classify the relevance of legal documents to a query with an Isaacus universal
6565
legal AI classifier.
@@ -121,7 +121,7 @@ def create(
121121
options=make_request_options(
122122
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
123123
),
124-
cast_to=UniversalClassification,
124+
cast_to=UniversalClassificationResponse,
125125
)
126126

127127

@@ -160,7 +160,7 @@ async def create(
160160
extra_query: Query | None = None,
161161
extra_body: Body | None = None,
162162
timeout: float | httpx.Timeout | None | NotGiven = not_given,
163-
) -> UniversalClassification:
163+
) -> UniversalClassificationResponse:
164164
"""
165165
Classify the relevance of legal documents to a query with an Isaacus universal
166166
legal AI classifier.
@@ -222,7 +222,7 @@ async def create(
222222
options=make_request_options(
223223
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
224224
),
225-
cast_to=UniversalClassification,
225+
cast_to=UniversalClassificationResponse,
226226
)
227227

228228

src/isaacus/resources/embeddings.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
async_to_streamed_response_wrapper,
2020
)
2121
from .._base_client import make_request_options
22-
from ..types.embedding import Embedding
22+
from ..types.embedding_response import EmbeddingResponse
2323

2424
__all__ = ["EmbeddingsResource", "AsyncEmbeddingsResource"]
2525

@@ -58,7 +58,7 @@ def create(
5858
extra_query: Query | None = None,
5959
extra_body: Body | None = None,
6060
timeout: float | httpx.Timeout | None | NotGiven = not_given,
61-
) -> Embedding:
61+
) -> EmbeddingResponse:
6262
"""
6363
Embed legal texts with an Isaacus legal AI embedder.
6464
@@ -113,7 +113,7 @@ def create(
113113
options=make_request_options(
114114
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
115115
),
116-
cast_to=Embedding,
116+
cast_to=EmbeddingResponse,
117117
)
118118

119119

@@ -151,7 +151,7 @@ async def create(
151151
extra_query: Query | None = None,
152152
extra_body: Body | None = None,
153153
timeout: float | httpx.Timeout | None | NotGiven = not_given,
154-
) -> Embedding:
154+
) -> EmbeddingResponse:
155155
"""
156156
Embed legal texts with an Isaacus legal AI embedder.
157157
@@ -206,7 +206,7 @@ async def create(
206206
options=make_request_options(
207207
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
208208
),
209-
cast_to=Embedding,
209+
cast_to=EmbeddingResponse,
210210
)
211211

212212

src/isaacus/resources/extractions/qa.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
)
2020
from ..._base_client import make_request_options
2121
from ...types.extractions import qa_create_params
22-
from ...types.extractions.answer_extraction import AnswerExtraction
22+
from ...types.extractions.answer_extraction_response import AnswerExtractionResponse
2323

2424
__all__ = ["QaResource", "AsyncQaResource"]
2525

@@ -59,7 +59,7 @@ def create(
5959
extra_query: Query | None = None,
6060
extra_body: Body | None = None,
6161
timeout: float | httpx.Timeout | None | NotGiven = not_given,
62-
) -> AnswerExtraction:
62+
) -> AnswerExtractionResponse:
6363
"""
6464
Extract answers to questions from legal documents with an Isaacus legal AI
6565
answer extractor.
@@ -119,7 +119,7 @@ def create(
119119
options=make_request_options(
120120
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
121121
),
122-
cast_to=AnswerExtraction,
122+
cast_to=AnswerExtractionResponse,
123123
)
124124

125125

@@ -158,7 +158,7 @@ async def create(
158158
extra_query: Query | None = None,
159159
extra_body: Body | None = None,
160160
timeout: float | httpx.Timeout | None | NotGiven = not_given,
161-
) -> AnswerExtraction:
161+
) -> AnswerExtractionResponse:
162162
"""
163163
Extract answers to questions from legal documents with an Isaacus legal AI
164164
answer extractor.
@@ -218,7 +218,7 @@ async def create(
218218
options=make_request_options(
219219
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
220220
),
221-
cast_to=AnswerExtraction,
221+
cast_to=AnswerExtractionResponse,
222222
)
223223

224224

src/isaacus/resources/rerankings.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
async_to_streamed_response_wrapper,
2020
)
2121
from .._base_client import make_request_options
22-
from ..types.reranking import Reranking
22+
from ..types.reranking_response import RerankingResponse
2323

2424
__all__ = ["RerankingsResource", "AsyncRerankingsResource"]
2525

@@ -60,7 +60,7 @@ def create(
6060
extra_query: Query | None = None,
6161
extra_body: Body | None = None,
6262
timeout: float | httpx.Timeout | None | NotGiven = not_given,
63-
) -> Reranking:
63+
) -> RerankingResponse:
6464
"""
6565
Rerank legal documents by their relevance to a query with an Isaacus legal AI
6666
reranker.
@@ -131,7 +131,7 @@ def create(
131131
options=make_request_options(
132132
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
133133
),
134-
cast_to=Reranking,
134+
cast_to=RerankingResponse,
135135
)
136136

137137

@@ -171,7 +171,7 @@ async def create(
171171
extra_query: Query | None = None,
172172
extra_body: Body | None = None,
173173
timeout: float | httpx.Timeout | None | NotGiven = not_given,
174-
) -> Reranking:
174+
) -> RerankingResponse:
175175
"""
176176
Rerank legal documents by their relevance to a query with an Isaacus legal AI
177177
reranker.
@@ -242,7 +242,7 @@ async def create(
242242
options=make_request_options(
243243
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
244244
),
245-
cast_to=Reranking,
245+
cast_to=RerankingResponse,
246246
)
247247

248248

src/isaacus/types/__init__.py

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

33
from __future__ import annotations
44

5-
from .embedding import Embedding as Embedding
6-
from .reranking import Reranking as Reranking
5+
from .embedding_response import EmbeddingResponse as EmbeddingResponse
6+
from .reranking_response import RerankingResponse as RerankingResponse
77
from .embedding_create_params import EmbeddingCreateParams as EmbeddingCreateParams
88
from .reranking_create_params import RerankingCreateParams as RerankingCreateParams

src/isaacus/types/classifications/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
from __future__ import annotations
44

55
from .universal_create_params import UniversalCreateParams as UniversalCreateParams
6-
from .universal_classification import UniversalClassification as UniversalClassification
6+
from .universal_classification_response import UniversalClassificationResponse as UniversalClassificationResponse

src/isaacus/types/classifications/universal_classification.py renamed to src/isaacus/types/classifications/universal_classification_response.py

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

55
from ..._models import BaseModel
66

7-
__all__ = ["UniversalClassification", "Classification", "ClassificationChunk", "Usage"]
7+
__all__ = ["UniversalClassificationResponse", "Classification", "ClassificationChunk", "Usage"]
88

99

1010
class ClassificationChunk(BaseModel):
@@ -72,7 +72,7 @@ class Usage(BaseModel):
7272
"""The number of tokens inputted to the model."""
7373

7474

75-
class UniversalClassification(BaseModel):
75+
class UniversalClassificationResponse(BaseModel):
7676
classifications: List[Classification]
7777
"""
7878
The classifications of the texts, by relevance to the query, in order from

0 commit comments

Comments
 (0)