Skip to content

Commit 562f11d

Browse files
ci(sdk): bump api version to force sdk refresh
1 parent eb4057b commit 562f11d

17 files changed

+1417
-21
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 4
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/isaacus%2Fisaacus-6705b8e0baa0e4aad69a1c04e9876b352e40e0e5caf21e87e7b2c355e70c4e66.yml
3-
openapi_spec_hash: 87d3cc80f5ddc5275e8a47d35f1a484e
1+
configured_endpoints: 5
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/isaacus%2Fisaacus-99dc0da03e73ae9e78d667dfaca5da19c9a0ad9d3983b103cdefb13b72114b4b.yml
3+
openapi_spec_hash: 6453366c1968ad787a016bce5d19a5b3
44
config_hash: 1d77b499f5b4f2dc6986fdd5936d18ef

api.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,15 @@ from isaacus.types.extractions import AnswerExtractionResponse
4949
Methods:
5050

5151
- <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>
52+
53+
# Enrichments
54+
55+
Types:
56+
57+
```python
58+
from isaacus.types import EnrichmentResponse
59+
```
60+
61+
Methods:
62+
63+
- <code title="post /enrichments">client.enrichments.<a href="./src/isaacus/resources/enrichments.py">create</a>(\*\*<a href="src/isaacus/types/enrichment_create_params.py">params</a>) -> <a href="./src/isaacus/types/enrichment_response.py">EnrichmentResponse</a></code>

src/isaacus/_client.py

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@
3131
)
3232

3333
if TYPE_CHECKING:
34-
from .resources import embeddings, rerankings, extractions, classifications
34+
from .resources import embeddings, rerankings, enrichments, extractions, classifications
3535
from .resources.embeddings import EmbeddingsResource, AsyncEmbeddingsResource
3636
from .resources.rerankings import RerankingsResource, AsyncRerankingsResource
37+
from .resources.enrichments import EnrichmentsResource, AsyncEnrichmentsResource
3738
from .resources.extractions.extractions import ExtractionsResource, AsyncExtractionsResource
3839
from .resources.classifications.classifications import ClassificationsResource, AsyncClassificationsResource
3940

@@ -119,6 +120,12 @@ def extractions(self) -> ExtractionsResource:
119120

120121
return ExtractionsResource(self)
121122

123+
@cached_property
124+
def enrichments(self) -> EnrichmentsResource:
125+
from .resources.enrichments import EnrichmentsResource
126+
127+
return EnrichmentsResource(self)
128+
122129
@cached_property
123130
def with_raw_response(self) -> IsaacusWithRawResponse:
124131
return IsaacusWithRawResponse(self)
@@ -311,6 +318,12 @@ def extractions(self) -> AsyncExtractionsResource:
311318

312319
return AsyncExtractionsResource(self)
313320

321+
@cached_property
322+
def enrichments(self) -> AsyncEnrichmentsResource:
323+
from .resources.enrichments import AsyncEnrichmentsResource
324+
325+
return AsyncEnrichmentsResource(self)
326+
314327
@cached_property
315328
def with_raw_response(self) -> AsyncIsaacusWithRawResponse:
316329
return AsyncIsaacusWithRawResponse(self)
@@ -454,6 +467,12 @@ def extractions(self) -> extractions.ExtractionsResourceWithRawResponse:
454467

455468
return ExtractionsResourceWithRawResponse(self._client.extractions)
456469

470+
@cached_property
471+
def enrichments(self) -> enrichments.EnrichmentsResourceWithRawResponse:
472+
from .resources.enrichments import EnrichmentsResourceWithRawResponse
473+
474+
return EnrichmentsResourceWithRawResponse(self._client.enrichments)
475+
457476

458477
class AsyncIsaacusWithRawResponse:
459478
_client: AsyncIsaacus
@@ -485,6 +504,12 @@ def extractions(self) -> extractions.AsyncExtractionsResourceWithRawResponse:
485504

486505
return AsyncExtractionsResourceWithRawResponse(self._client.extractions)
487506

507+
@cached_property
508+
def enrichments(self) -> enrichments.AsyncEnrichmentsResourceWithRawResponse:
509+
from .resources.enrichments import AsyncEnrichmentsResourceWithRawResponse
510+
511+
return AsyncEnrichmentsResourceWithRawResponse(self._client.enrichments)
512+
488513

489514
class IsaacusWithStreamedResponse:
490515
_client: Isaacus
@@ -516,6 +541,12 @@ def extractions(self) -> extractions.ExtractionsResourceWithStreamingResponse:
516541

517542
return ExtractionsResourceWithStreamingResponse(self._client.extractions)
518543

544+
@cached_property
545+
def enrichments(self) -> enrichments.EnrichmentsResourceWithStreamingResponse:
546+
from .resources.enrichments import EnrichmentsResourceWithStreamingResponse
547+
548+
return EnrichmentsResourceWithStreamingResponse(self._client.enrichments)
549+
519550

520551
class AsyncIsaacusWithStreamedResponse:
521552
_client: AsyncIsaacus
@@ -547,6 +578,12 @@ def extractions(self) -> extractions.AsyncExtractionsResourceWithStreamingRespon
547578

548579
return AsyncExtractionsResourceWithStreamingResponse(self._client.extractions)
549580

581+
@cached_property
582+
def enrichments(self) -> enrichments.AsyncEnrichmentsResourceWithStreamingResponse:
583+
from .resources.enrichments import AsyncEnrichmentsResourceWithStreamingResponse
584+
585+
return AsyncEnrichmentsResourceWithStreamingResponse(self._client.enrichments)
586+
550587

551588
Client = Isaacus
552589

src/isaacus/resources/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@
1616
RerankingsResourceWithStreamingResponse,
1717
AsyncRerankingsResourceWithStreamingResponse,
1818
)
19+
from .enrichments import (
20+
EnrichmentsResource,
21+
AsyncEnrichmentsResource,
22+
EnrichmentsResourceWithRawResponse,
23+
AsyncEnrichmentsResourceWithRawResponse,
24+
EnrichmentsResourceWithStreamingResponse,
25+
AsyncEnrichmentsResourceWithStreamingResponse,
26+
)
1927
from .extractions import (
2028
ExtractionsResource,
2129
AsyncExtractionsResource,
@@ -58,4 +66,10 @@
5866
"AsyncExtractionsResourceWithRawResponse",
5967
"ExtractionsResourceWithStreamingResponse",
6068
"AsyncExtractionsResourceWithStreamingResponse",
69+
"EnrichmentsResource",
70+
"AsyncEnrichmentsResource",
71+
"EnrichmentsResourceWithRawResponse",
72+
"AsyncEnrichmentsResourceWithRawResponse",
73+
"EnrichmentsResourceWithStreamingResponse",
74+
"AsyncEnrichmentsResourceWithStreamingResponse",
6175
]
Lines changed: 224 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,224 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing import Union, Optional
6+
from typing_extensions import Literal
7+
8+
import httpx
9+
10+
from ..types import enrichment_create_params
11+
from .._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
12+
from .._utils import maybe_transform, async_maybe_transform
13+
from .._compat import cached_property
14+
from .._resource import SyncAPIResource, AsyncAPIResource
15+
from .._response import (
16+
to_raw_response_wrapper,
17+
to_streamed_response_wrapper,
18+
async_to_raw_response_wrapper,
19+
async_to_streamed_response_wrapper,
20+
)
21+
from .._base_client import make_request_options
22+
from ..types.enrichment_response import EnrichmentResponse
23+
24+
__all__ = ["EnrichmentsResource", "AsyncEnrichmentsResource"]
25+
26+
27+
class EnrichmentsResource(SyncAPIResource):
28+
@cached_property
29+
def with_raw_response(self) -> EnrichmentsResourceWithRawResponse:
30+
"""
31+
This property can be used as a prefix for any HTTP method call to return
32+
the raw response object instead of the parsed content.
33+
34+
For more information, see https://www.github.com/isaacus-dev/isaacus-python#accessing-raw-response-data-eg-headers
35+
"""
36+
return EnrichmentsResourceWithRawResponse(self)
37+
38+
@cached_property
39+
def with_streaming_response(self) -> EnrichmentsResourceWithStreamingResponse:
40+
"""
41+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
42+
43+
For more information, see https://www.github.com/isaacus-dev/isaacus-python#with_streaming_response
44+
"""
45+
return EnrichmentsResourceWithStreamingResponse(self)
46+
47+
def create(
48+
self,
49+
*,
50+
model: Literal["kanon-2-enricher-preview"],
51+
texts: Union[SequenceNotStr[str], str],
52+
overflow_strategy: Optional[Literal["auto", "drop_end"]] | Omit = omit,
53+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
54+
# The extra values given here take precedence over values defined on the client or passed to this method.
55+
extra_headers: Headers | None = None,
56+
extra_query: Query | None = None,
57+
extra_body: Body | None = None,
58+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
59+
) -> EnrichmentResponse:
60+
"""
61+
Enrich documents with an Isaacus enricher model.
62+
63+
Args:
64+
model: The ID of the [model](https://docs.isaacus.com/models#enrichment) to use for
65+
enrichment.
66+
67+
texts: A text or array of texts to be enriched, each containing at least one
68+
non-whitespace character.
69+
70+
No more than 8 texts can be enriched in a single request.
71+
72+
overflow_strategy: The strategy for handling content exceeding the model's maximum input length.
73+
74+
`auto` currently behaves the same as `drop_end`, dropping excess tokens from the
75+
end of input. In the future, `auto` may implement more sophisticated strategies
76+
such as chunking and context-aware stitching.
77+
78+
`drop_end` drops tokens from the end of input exceeding the model's maximum
79+
input length.
80+
81+
`null`, which is the default setting, raises an error if the input exceeds the
82+
model's maximum input length.
83+
84+
extra_headers: Send extra headers
85+
86+
extra_query: Add additional query parameters to the request
87+
88+
extra_body: Add additional JSON properties to the request
89+
90+
timeout: Override the client-level default timeout for this request, in seconds
91+
"""
92+
return self._post(
93+
"/enrichments",
94+
body=maybe_transform(
95+
{
96+
"model": model,
97+
"texts": texts,
98+
"overflow_strategy": overflow_strategy,
99+
},
100+
enrichment_create_params.EnrichmentCreateParams,
101+
),
102+
options=make_request_options(
103+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
104+
),
105+
cast_to=EnrichmentResponse,
106+
)
107+
108+
109+
class AsyncEnrichmentsResource(AsyncAPIResource):
110+
@cached_property
111+
def with_raw_response(self) -> AsyncEnrichmentsResourceWithRawResponse:
112+
"""
113+
This property can be used as a prefix for any HTTP method call to return
114+
the raw response object instead of the parsed content.
115+
116+
For more information, see https://www.github.com/isaacus-dev/isaacus-python#accessing-raw-response-data-eg-headers
117+
"""
118+
return AsyncEnrichmentsResourceWithRawResponse(self)
119+
120+
@cached_property
121+
def with_streaming_response(self) -> AsyncEnrichmentsResourceWithStreamingResponse:
122+
"""
123+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
124+
125+
For more information, see https://www.github.com/isaacus-dev/isaacus-python#with_streaming_response
126+
"""
127+
return AsyncEnrichmentsResourceWithStreamingResponse(self)
128+
129+
async def create(
130+
self,
131+
*,
132+
model: Literal["kanon-2-enricher-preview"],
133+
texts: Union[SequenceNotStr[str], str],
134+
overflow_strategy: Optional[Literal["auto", "drop_end"]] | Omit = omit,
135+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
136+
# The extra values given here take precedence over values defined on the client or passed to this method.
137+
extra_headers: Headers | None = None,
138+
extra_query: Query | None = None,
139+
extra_body: Body | None = None,
140+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
141+
) -> EnrichmentResponse:
142+
"""
143+
Enrich documents with an Isaacus enricher model.
144+
145+
Args:
146+
model: The ID of the [model](https://docs.isaacus.com/models#enrichment) to use for
147+
enrichment.
148+
149+
texts: A text or array of texts to be enriched, each containing at least one
150+
non-whitespace character.
151+
152+
No more than 8 texts can be enriched in a single request.
153+
154+
overflow_strategy: The strategy for handling content exceeding the model's maximum input length.
155+
156+
`auto` currently behaves the same as `drop_end`, dropping excess tokens from the
157+
end of input. In the future, `auto` may implement more sophisticated strategies
158+
such as chunking and context-aware stitching.
159+
160+
`drop_end` drops tokens from the end of input exceeding the model's maximum
161+
input length.
162+
163+
`null`, which is the default setting, raises an error if the input exceeds the
164+
model's maximum input length.
165+
166+
extra_headers: Send extra headers
167+
168+
extra_query: Add additional query parameters to the request
169+
170+
extra_body: Add additional JSON properties to the request
171+
172+
timeout: Override the client-level default timeout for this request, in seconds
173+
"""
174+
return await self._post(
175+
"/enrichments",
176+
body=await async_maybe_transform(
177+
{
178+
"model": model,
179+
"texts": texts,
180+
"overflow_strategy": overflow_strategy,
181+
},
182+
enrichment_create_params.EnrichmentCreateParams,
183+
),
184+
options=make_request_options(
185+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
186+
),
187+
cast_to=EnrichmentResponse,
188+
)
189+
190+
191+
class EnrichmentsResourceWithRawResponse:
192+
def __init__(self, enrichments: EnrichmentsResource) -> None:
193+
self._enrichments = enrichments
194+
195+
self.create = to_raw_response_wrapper(
196+
enrichments.create,
197+
)
198+
199+
200+
class AsyncEnrichmentsResourceWithRawResponse:
201+
def __init__(self, enrichments: AsyncEnrichmentsResource) -> None:
202+
self._enrichments = enrichments
203+
204+
self.create = async_to_raw_response_wrapper(
205+
enrichments.create,
206+
)
207+
208+
209+
class EnrichmentsResourceWithStreamingResponse:
210+
def __init__(self, enrichments: EnrichmentsResource) -> None:
211+
self._enrichments = enrichments
212+
213+
self.create = to_streamed_response_wrapper(
214+
enrichments.create,
215+
)
216+
217+
218+
class AsyncEnrichmentsResourceWithStreamingResponse:
219+
def __init__(self, enrichments: AsyncEnrichmentsResource) -> None:
220+
self._enrichments = enrichments
221+
222+
self.create = async_to_streamed_response_wrapper(
223+
enrichments.create,
224+
)

src/isaacus/resources/rerankings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def create(
6262
timeout: float | httpx.Timeout | None | NotGiven = not_given,
6363
) -> RerankingResponse:
6464
"""
65-
Rerank legal documents by their relevance to a query with an Isaacus legal AI
65+
Rank legal documents by their relevance to a query with an Isaacus legal AI
6666
reranker.
6767
6868
Args:
@@ -173,7 +173,7 @@ async def create(
173173
timeout: float | httpx.Timeout | None | NotGiven = not_given,
174174
) -> RerankingResponse:
175175
"""
176-
Rerank legal documents by their relevance to a query with an Isaacus legal AI
176+
Rank legal documents by their relevance to a query with an Isaacus legal AI
177177
reranker.
178178
179179
Args:

src/isaacus/types/__init__.py

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

55
from .embedding_response import EmbeddingResponse as EmbeddingResponse
66
from .reranking_response import RerankingResponse as RerankingResponse
7+
from .enrichment_response import EnrichmentResponse as EnrichmentResponse
78
from .embedding_create_params import EmbeddingCreateParams as EmbeddingCreateParams
89
from .reranking_create_params import RerankingCreateParams as RerankingCreateParams
10+
from .enrichment_create_params import EnrichmentCreateParams as EnrichmentCreateParams

0 commit comments

Comments
 (0)