isaacus 0.3.0__py3-none-any.whl → 0.3.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- isaacus/_client.py +9 -0
- isaacus/_version.py +1 -1
- isaacus/resources/__init__.py +14 -0
- isaacus/resources/rerankings.py +285 -0
- isaacus/types/__init__.py +3 -0
- isaacus/types/reranking.py +37 -0
- isaacus/types/reranking_create_params.py +75 -0
- {isaacus-0.3.0.dist-info → isaacus-0.3.2.dist-info}/METADATA +1 -1
- {isaacus-0.3.0.dist-info → isaacus-0.3.2.dist-info}/RECORD +11 -8
- {isaacus-0.3.0.dist-info → isaacus-0.3.2.dist-info}/WHEEL +0 -0
- {isaacus-0.3.0.dist-info → isaacus-0.3.2.dist-info}/licenses/LICENSE +0 -0
isaacus/_client.py
CHANGED
@@ -24,6 +24,7 @@ from ._utils import (
|
|
24
24
|
get_async_library,
|
25
25
|
)
|
26
26
|
from ._version import __version__
|
27
|
+
from .resources import rerankings
|
27
28
|
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
|
28
29
|
from ._exceptions import IsaacusError, APIStatusError
|
29
30
|
from ._base_client import (
|
@@ -38,6 +39,7 @@ __all__ = ["Timeout", "Transport", "ProxiesTypes", "RequestOptions", "Isaacus",
|
|
38
39
|
|
39
40
|
class Isaacus(SyncAPIClient):
|
40
41
|
classifications: classifications.ClassificationsResource
|
42
|
+
rerankings: rerankings.RerankingsResource
|
41
43
|
with_raw_response: IsaacusWithRawResponse
|
42
44
|
with_streaming_response: IsaacusWithStreamedResponse
|
43
45
|
|
@@ -96,6 +98,7 @@ class Isaacus(SyncAPIClient):
|
|
96
98
|
)
|
97
99
|
|
98
100
|
self.classifications = classifications.ClassificationsResource(self)
|
101
|
+
self.rerankings = rerankings.RerankingsResource(self)
|
99
102
|
self.with_raw_response = IsaacusWithRawResponse(self)
|
100
103
|
self.with_streaming_response = IsaacusWithStreamedResponse(self)
|
101
104
|
|
@@ -206,6 +209,7 @@ class Isaacus(SyncAPIClient):
|
|
206
209
|
|
207
210
|
class AsyncIsaacus(AsyncAPIClient):
|
208
211
|
classifications: classifications.AsyncClassificationsResource
|
212
|
+
rerankings: rerankings.AsyncRerankingsResource
|
209
213
|
with_raw_response: AsyncIsaacusWithRawResponse
|
210
214
|
with_streaming_response: AsyncIsaacusWithStreamedResponse
|
211
215
|
|
@@ -264,6 +268,7 @@ class AsyncIsaacus(AsyncAPIClient):
|
|
264
268
|
)
|
265
269
|
|
266
270
|
self.classifications = classifications.AsyncClassificationsResource(self)
|
271
|
+
self.rerankings = rerankings.AsyncRerankingsResource(self)
|
267
272
|
self.with_raw_response = AsyncIsaacusWithRawResponse(self)
|
268
273
|
self.with_streaming_response = AsyncIsaacusWithStreamedResponse(self)
|
269
274
|
|
@@ -375,21 +380,25 @@ class AsyncIsaacus(AsyncAPIClient):
|
|
375
380
|
class IsaacusWithRawResponse:
|
376
381
|
def __init__(self, client: Isaacus) -> None:
|
377
382
|
self.classifications = classifications.ClassificationsResourceWithRawResponse(client.classifications)
|
383
|
+
self.rerankings = rerankings.RerankingsResourceWithRawResponse(client.rerankings)
|
378
384
|
|
379
385
|
|
380
386
|
class AsyncIsaacusWithRawResponse:
|
381
387
|
def __init__(self, client: AsyncIsaacus) -> None:
|
382
388
|
self.classifications = classifications.AsyncClassificationsResourceWithRawResponse(client.classifications)
|
389
|
+
self.rerankings = rerankings.AsyncRerankingsResourceWithRawResponse(client.rerankings)
|
383
390
|
|
384
391
|
|
385
392
|
class IsaacusWithStreamedResponse:
|
386
393
|
def __init__(self, client: Isaacus) -> None:
|
387
394
|
self.classifications = classifications.ClassificationsResourceWithStreamingResponse(client.classifications)
|
395
|
+
self.rerankings = rerankings.RerankingsResourceWithStreamingResponse(client.rerankings)
|
388
396
|
|
389
397
|
|
390
398
|
class AsyncIsaacusWithStreamedResponse:
|
391
399
|
def __init__(self, client: AsyncIsaacus) -> None:
|
392
400
|
self.classifications = classifications.AsyncClassificationsResourceWithStreamingResponse(client.classifications)
|
401
|
+
self.rerankings = rerankings.AsyncRerankingsResourceWithStreamingResponse(client.rerankings)
|
393
402
|
|
394
403
|
|
395
404
|
Client = Isaacus
|
isaacus/_version.py
CHANGED
isaacus/resources/__init__.py
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
2
|
|
3
|
+
from .rerankings import (
|
4
|
+
RerankingsResource,
|
5
|
+
AsyncRerankingsResource,
|
6
|
+
RerankingsResourceWithRawResponse,
|
7
|
+
AsyncRerankingsResourceWithRawResponse,
|
8
|
+
RerankingsResourceWithStreamingResponse,
|
9
|
+
AsyncRerankingsResourceWithStreamingResponse,
|
10
|
+
)
|
3
11
|
from .classifications import (
|
4
12
|
ClassificationsResource,
|
5
13
|
AsyncClassificationsResource,
|
@@ -16,4 +24,10 @@ __all__ = [
|
|
16
24
|
"AsyncClassificationsResourceWithRawResponse",
|
17
25
|
"ClassificationsResourceWithStreamingResponse",
|
18
26
|
"AsyncClassificationsResourceWithStreamingResponse",
|
27
|
+
"RerankingsResource",
|
28
|
+
"AsyncRerankingsResource",
|
29
|
+
"RerankingsResourceWithRawResponse",
|
30
|
+
"AsyncRerankingsResourceWithRawResponse",
|
31
|
+
"RerankingsResourceWithStreamingResponse",
|
32
|
+
"AsyncRerankingsResourceWithStreamingResponse",
|
19
33
|
]
|
@@ -0,0 +1,285 @@
|
|
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 List, Optional
|
6
|
+
from typing_extensions import Literal
|
7
|
+
|
8
|
+
import httpx
|
9
|
+
|
10
|
+
from ..types import reranking_create_params
|
11
|
+
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
12
|
+
from .._utils import (
|
13
|
+
maybe_transform,
|
14
|
+
async_maybe_transform,
|
15
|
+
)
|
16
|
+
from .._compat import cached_property
|
17
|
+
from .._resource import SyncAPIResource, AsyncAPIResource
|
18
|
+
from .._response import (
|
19
|
+
to_raw_response_wrapper,
|
20
|
+
to_streamed_response_wrapper,
|
21
|
+
async_to_raw_response_wrapper,
|
22
|
+
async_to_streamed_response_wrapper,
|
23
|
+
)
|
24
|
+
from .._base_client import make_request_options
|
25
|
+
from ..types.reranking import Reranking
|
26
|
+
|
27
|
+
__all__ = ["RerankingsResource", "AsyncRerankingsResource"]
|
28
|
+
|
29
|
+
|
30
|
+
class RerankingsResource(SyncAPIResource):
|
31
|
+
@cached_property
|
32
|
+
def with_raw_response(self) -> RerankingsResourceWithRawResponse:
|
33
|
+
"""
|
34
|
+
This property can be used as a prefix for any HTTP method call to return
|
35
|
+
the raw response object instead of the parsed content.
|
36
|
+
|
37
|
+
For more information, see https://www.github.com/isaacus-dev/isaacus-python#accessing-raw-response-data-eg-headers
|
38
|
+
"""
|
39
|
+
return RerankingsResourceWithRawResponse(self)
|
40
|
+
|
41
|
+
@cached_property
|
42
|
+
def with_streaming_response(self) -> RerankingsResourceWithStreamingResponse:
|
43
|
+
"""
|
44
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
45
|
+
|
46
|
+
For more information, see https://www.github.com/isaacus-dev/isaacus-python#with_streaming_response
|
47
|
+
"""
|
48
|
+
return RerankingsResourceWithStreamingResponse(self)
|
49
|
+
|
50
|
+
def create(
|
51
|
+
self,
|
52
|
+
*,
|
53
|
+
model: Literal["kanon-universal-classifier", "kanon-universal-classifier-mini"],
|
54
|
+
query: str,
|
55
|
+
texts: List[str],
|
56
|
+
chunking_options: Optional[reranking_create_params.ChunkingOptions] | NotGiven = NOT_GIVEN,
|
57
|
+
is_iql: bool | NotGiven = NOT_GIVEN,
|
58
|
+
scoring_method: Literal["auto", "chunk_max", "chunk_avg", "chunk_min"] | NotGiven = NOT_GIVEN,
|
59
|
+
top_n: Optional[int] | NotGiven = NOT_GIVEN,
|
60
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
61
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
62
|
+
extra_headers: Headers | None = None,
|
63
|
+
extra_query: Query | None = None,
|
64
|
+
extra_body: Body | None = None,
|
65
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
66
|
+
) -> Reranking:
|
67
|
+
"""
|
68
|
+
Rerank legal documents by their relevance to a query with an Isaacus legal AI
|
69
|
+
reranker.
|
70
|
+
|
71
|
+
Args:
|
72
|
+
model: The ID of the [model](https://docs.isaacus.com/models#reranking) to use for
|
73
|
+
reranking.
|
74
|
+
|
75
|
+
query: The query to evaluate the relevance of the texts to.
|
76
|
+
|
77
|
+
The query must contain at least one non-whitespace character.
|
78
|
+
|
79
|
+
Unlike the texts being reranked, the query cannot be so long that it exceeds the
|
80
|
+
maximum input length of the reranker.
|
81
|
+
|
82
|
+
texts: The texts to rerank.
|
83
|
+
|
84
|
+
There must be at least one text.
|
85
|
+
|
86
|
+
The texts must contain at least one non-whitespace character.
|
87
|
+
|
88
|
+
chunking_options: Options for how to split text into smaller chunks.
|
89
|
+
|
90
|
+
is_iql: Whether the query should be interpreted as an
|
91
|
+
[Isaacus Query Language (IQL)](https://docs.isaacus.com/iql) query, which is not
|
92
|
+
the case by default.
|
93
|
+
|
94
|
+
If you allow untrusted users to construct their own queries, think carefully
|
95
|
+
before enabling IQL since queries can be crafted to consume an excessively large
|
96
|
+
amount of tokens.
|
97
|
+
|
98
|
+
scoring_method: The method to use for producing an overall relevance score for a text.
|
99
|
+
|
100
|
+
`auto` is the default scoring method and is recommended for most use cases.
|
101
|
+
Currently, it is equivalent to `chunk_max`. In the future, it will automatically
|
102
|
+
select the best method based on the model and inputs.
|
103
|
+
|
104
|
+
`chunk_max` uses the highest relevance score of all of a text's chunks.
|
105
|
+
|
106
|
+
`chunk_avg` averages the relevance scores of all of a text's chunks.
|
107
|
+
|
108
|
+
`chunk_min` uses the lowest relevance score of all of a text's chunks.
|
109
|
+
|
110
|
+
top_n: A whole number greater than or equal to 1.
|
111
|
+
|
112
|
+
extra_headers: Send extra headers
|
113
|
+
|
114
|
+
extra_query: Add additional query parameters to the request
|
115
|
+
|
116
|
+
extra_body: Add additional JSON properties to the request
|
117
|
+
|
118
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
119
|
+
"""
|
120
|
+
return self._post(
|
121
|
+
"/rerankings",
|
122
|
+
body=maybe_transform(
|
123
|
+
{
|
124
|
+
"model": model,
|
125
|
+
"query": query,
|
126
|
+
"texts": texts,
|
127
|
+
"chunking_options": chunking_options,
|
128
|
+
"is_iql": is_iql,
|
129
|
+
"scoring_method": scoring_method,
|
130
|
+
"top_n": top_n,
|
131
|
+
},
|
132
|
+
reranking_create_params.RerankingCreateParams,
|
133
|
+
),
|
134
|
+
options=make_request_options(
|
135
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
136
|
+
),
|
137
|
+
cast_to=Reranking,
|
138
|
+
)
|
139
|
+
|
140
|
+
|
141
|
+
class AsyncRerankingsResource(AsyncAPIResource):
|
142
|
+
@cached_property
|
143
|
+
def with_raw_response(self) -> AsyncRerankingsResourceWithRawResponse:
|
144
|
+
"""
|
145
|
+
This property can be used as a prefix for any HTTP method call to return
|
146
|
+
the raw response object instead of the parsed content.
|
147
|
+
|
148
|
+
For more information, see https://www.github.com/isaacus-dev/isaacus-python#accessing-raw-response-data-eg-headers
|
149
|
+
"""
|
150
|
+
return AsyncRerankingsResourceWithRawResponse(self)
|
151
|
+
|
152
|
+
@cached_property
|
153
|
+
def with_streaming_response(self) -> AsyncRerankingsResourceWithStreamingResponse:
|
154
|
+
"""
|
155
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
156
|
+
|
157
|
+
For more information, see https://www.github.com/isaacus-dev/isaacus-python#with_streaming_response
|
158
|
+
"""
|
159
|
+
return AsyncRerankingsResourceWithStreamingResponse(self)
|
160
|
+
|
161
|
+
async def create(
|
162
|
+
self,
|
163
|
+
*,
|
164
|
+
model: Literal["kanon-universal-classifier", "kanon-universal-classifier-mini"],
|
165
|
+
query: str,
|
166
|
+
texts: List[str],
|
167
|
+
chunking_options: Optional[reranking_create_params.ChunkingOptions] | NotGiven = NOT_GIVEN,
|
168
|
+
is_iql: bool | NotGiven = NOT_GIVEN,
|
169
|
+
scoring_method: Literal["auto", "chunk_max", "chunk_avg", "chunk_min"] | NotGiven = NOT_GIVEN,
|
170
|
+
top_n: Optional[int] | NotGiven = NOT_GIVEN,
|
171
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
172
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
173
|
+
extra_headers: Headers | None = None,
|
174
|
+
extra_query: Query | None = None,
|
175
|
+
extra_body: Body | None = None,
|
176
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
177
|
+
) -> Reranking:
|
178
|
+
"""
|
179
|
+
Rerank legal documents by their relevance to a query with an Isaacus legal AI
|
180
|
+
reranker.
|
181
|
+
|
182
|
+
Args:
|
183
|
+
model: The ID of the [model](https://docs.isaacus.com/models#reranking) to use for
|
184
|
+
reranking.
|
185
|
+
|
186
|
+
query: The query to evaluate the relevance of the texts to.
|
187
|
+
|
188
|
+
The query must contain at least one non-whitespace character.
|
189
|
+
|
190
|
+
Unlike the texts being reranked, the query cannot be so long that it exceeds the
|
191
|
+
maximum input length of the reranker.
|
192
|
+
|
193
|
+
texts: The texts to rerank.
|
194
|
+
|
195
|
+
There must be at least one text.
|
196
|
+
|
197
|
+
The texts must contain at least one non-whitespace character.
|
198
|
+
|
199
|
+
chunking_options: Options for how to split text into smaller chunks.
|
200
|
+
|
201
|
+
is_iql: Whether the query should be interpreted as an
|
202
|
+
[Isaacus Query Language (IQL)](https://docs.isaacus.com/iql) query, which is not
|
203
|
+
the case by default.
|
204
|
+
|
205
|
+
If you allow untrusted users to construct their own queries, think carefully
|
206
|
+
before enabling IQL since queries can be crafted to consume an excessively large
|
207
|
+
amount of tokens.
|
208
|
+
|
209
|
+
scoring_method: The method to use for producing an overall relevance score for a text.
|
210
|
+
|
211
|
+
`auto` is the default scoring method and is recommended for most use cases.
|
212
|
+
Currently, it is equivalent to `chunk_max`. In the future, it will automatically
|
213
|
+
select the best method based on the model and inputs.
|
214
|
+
|
215
|
+
`chunk_max` uses the highest relevance score of all of a text's chunks.
|
216
|
+
|
217
|
+
`chunk_avg` averages the relevance scores of all of a text's chunks.
|
218
|
+
|
219
|
+
`chunk_min` uses the lowest relevance score of all of a text's chunks.
|
220
|
+
|
221
|
+
top_n: A whole number greater than or equal to 1.
|
222
|
+
|
223
|
+
extra_headers: Send extra headers
|
224
|
+
|
225
|
+
extra_query: Add additional query parameters to the request
|
226
|
+
|
227
|
+
extra_body: Add additional JSON properties to the request
|
228
|
+
|
229
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
230
|
+
"""
|
231
|
+
return await self._post(
|
232
|
+
"/rerankings",
|
233
|
+
body=await async_maybe_transform(
|
234
|
+
{
|
235
|
+
"model": model,
|
236
|
+
"query": query,
|
237
|
+
"texts": texts,
|
238
|
+
"chunking_options": chunking_options,
|
239
|
+
"is_iql": is_iql,
|
240
|
+
"scoring_method": scoring_method,
|
241
|
+
"top_n": top_n,
|
242
|
+
},
|
243
|
+
reranking_create_params.RerankingCreateParams,
|
244
|
+
),
|
245
|
+
options=make_request_options(
|
246
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
247
|
+
),
|
248
|
+
cast_to=Reranking,
|
249
|
+
)
|
250
|
+
|
251
|
+
|
252
|
+
class RerankingsResourceWithRawResponse:
|
253
|
+
def __init__(self, rerankings: RerankingsResource) -> None:
|
254
|
+
self._rerankings = rerankings
|
255
|
+
|
256
|
+
self.create = to_raw_response_wrapper(
|
257
|
+
rerankings.create,
|
258
|
+
)
|
259
|
+
|
260
|
+
|
261
|
+
class AsyncRerankingsResourceWithRawResponse:
|
262
|
+
def __init__(self, rerankings: AsyncRerankingsResource) -> None:
|
263
|
+
self._rerankings = rerankings
|
264
|
+
|
265
|
+
self.create = async_to_raw_response_wrapper(
|
266
|
+
rerankings.create,
|
267
|
+
)
|
268
|
+
|
269
|
+
|
270
|
+
class RerankingsResourceWithStreamingResponse:
|
271
|
+
def __init__(self, rerankings: RerankingsResource) -> None:
|
272
|
+
self._rerankings = rerankings
|
273
|
+
|
274
|
+
self.create = to_streamed_response_wrapper(
|
275
|
+
rerankings.create,
|
276
|
+
)
|
277
|
+
|
278
|
+
|
279
|
+
class AsyncRerankingsResourceWithStreamingResponse:
|
280
|
+
def __init__(self, rerankings: AsyncRerankingsResource) -> None:
|
281
|
+
self._rerankings = rerankings
|
282
|
+
|
283
|
+
self.create = async_to_streamed_response_wrapper(
|
284
|
+
rerankings.create,
|
285
|
+
)
|
isaacus/types/__init__.py
CHANGED
@@ -0,0 +1,37 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from typing import List
|
4
|
+
|
5
|
+
from .._models import BaseModel
|
6
|
+
|
7
|
+
__all__ = ["Reranking", "Result", "Usage"]
|
8
|
+
|
9
|
+
|
10
|
+
class Result(BaseModel):
|
11
|
+
index: int
|
12
|
+
"""
|
13
|
+
The index of the text in the input array of texts, starting from `0` (and,
|
14
|
+
therefore, ending at the number of texts minus `1`).
|
15
|
+
"""
|
16
|
+
|
17
|
+
score: float
|
18
|
+
"""
|
19
|
+
A score between `0` and `1`, inclusive, representing the relevance of the text
|
20
|
+
to the query.
|
21
|
+
"""
|
22
|
+
|
23
|
+
|
24
|
+
class Usage(BaseModel):
|
25
|
+
input_tokens: int
|
26
|
+
"""The number of tokens inputted to the model."""
|
27
|
+
|
28
|
+
|
29
|
+
class Reranking(BaseModel):
|
30
|
+
results: List[Result]
|
31
|
+
"""
|
32
|
+
The rerankings of the texts, by relevance to the query, in order from highest to
|
33
|
+
lowest relevance score.
|
34
|
+
"""
|
35
|
+
|
36
|
+
usage: Usage
|
37
|
+
"""Statistics about the usage of resources in the process of reranking the texts."""
|
@@ -0,0 +1,75 @@
|
|
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 List, Optional
|
6
|
+
from typing_extensions import Literal, Required, TypedDict
|
7
|
+
|
8
|
+
__all__ = ["RerankingCreateParams", "ChunkingOptions"]
|
9
|
+
|
10
|
+
|
11
|
+
class RerankingCreateParams(TypedDict, total=False):
|
12
|
+
model: Required[Literal["kanon-universal-classifier", "kanon-universal-classifier-mini"]]
|
13
|
+
"""
|
14
|
+
The ID of the [model](https://docs.isaacus.com/models#reranking) to use for
|
15
|
+
reranking.
|
16
|
+
"""
|
17
|
+
|
18
|
+
query: Required[str]
|
19
|
+
"""The query to evaluate the relevance of the texts to.
|
20
|
+
|
21
|
+
The query must contain at least one non-whitespace character.
|
22
|
+
|
23
|
+
Unlike the texts being reranked, the query cannot be so long that it exceeds the
|
24
|
+
maximum input length of the reranker.
|
25
|
+
"""
|
26
|
+
|
27
|
+
texts: Required[List[str]]
|
28
|
+
"""The texts to rerank.
|
29
|
+
|
30
|
+
There must be at least one text.
|
31
|
+
|
32
|
+
The texts must contain at least one non-whitespace character.
|
33
|
+
"""
|
34
|
+
|
35
|
+
chunking_options: Optional[ChunkingOptions]
|
36
|
+
"""Options for how to split text into smaller chunks."""
|
37
|
+
|
38
|
+
is_iql: bool
|
39
|
+
"""
|
40
|
+
Whether the query should be interpreted as an
|
41
|
+
[Isaacus Query Language (IQL)](https://docs.isaacus.com/iql) query, which is not
|
42
|
+
the case by default.
|
43
|
+
|
44
|
+
If you allow untrusted users to construct their own queries, think carefully
|
45
|
+
before enabling IQL since queries can be crafted to consume an excessively large
|
46
|
+
amount of tokens.
|
47
|
+
"""
|
48
|
+
|
49
|
+
scoring_method: Literal["auto", "chunk_max", "chunk_avg", "chunk_min"]
|
50
|
+
"""The method to use for producing an overall relevance score for a text.
|
51
|
+
|
52
|
+
`auto` is the default scoring method and is recommended for most use cases.
|
53
|
+
Currently, it is equivalent to `chunk_max`. In the future, it will automatically
|
54
|
+
select the best method based on the model and inputs.
|
55
|
+
|
56
|
+
`chunk_max` uses the highest relevance score of all of a text's chunks.
|
57
|
+
|
58
|
+
`chunk_avg` averages the relevance scores of all of a text's chunks.
|
59
|
+
|
60
|
+
`chunk_min` uses the lowest relevance score of all of a text's chunks.
|
61
|
+
"""
|
62
|
+
|
63
|
+
top_n: Optional[int]
|
64
|
+
"""A whole number greater than or equal to 1."""
|
65
|
+
|
66
|
+
|
67
|
+
class ChunkingOptions(TypedDict, total=False):
|
68
|
+
overlap_ratio: Optional[float]
|
69
|
+
"""A number greater than or equal to 0 and less than 1."""
|
70
|
+
|
71
|
+
overlap_tokens: Optional[int]
|
72
|
+
"""A whole number greater than -1."""
|
73
|
+
|
74
|
+
size: Optional[int]
|
75
|
+
"""A whole number greater than or equal to 1."""
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: isaacus
|
3
|
-
Version: 0.3.
|
3
|
+
Version: 0.3.2
|
4
4
|
Summary: The official Python library for the isaacus API
|
5
5
|
Project-URL: Homepage, https://github.com/isaacus-dev/isaacus-python
|
6
6
|
Project-URL: Repository, https://github.com/isaacus-dev/isaacus-python
|
@@ -1,6 +1,6 @@
|
|
1
1
|
isaacus/__init__.py,sha256=Wgs-qjblN9tJvI22iWwi5CfiVvyn1drBPnTYhVj7cWk,2426
|
2
2
|
isaacus/_base_client.py,sha256=ORZD1WjSTLicI9Bv0nJdIF7OGDv0Wl4ySK0ygQ9AjM8,64958
|
3
|
-
isaacus/_client.py,sha256=
|
3
|
+
isaacus/_client.py,sha256=aqn4G8onxd-CBS_Tgnr9QA41g6ltcIScHsuUo9U1JeU,15874
|
4
4
|
isaacus/_compat.py,sha256=VWemUKbj6DDkQ-O4baSpHVLJafotzeXmCQGJugfVTIw,6580
|
5
5
|
isaacus/_constants.py,sha256=S14PFzyN9-I31wiV7SmIlL5Ga0MLHxdvegInGdXH7tM,462
|
6
6
|
isaacus/_exceptions.py,sha256=L82uluhizzc94VydHIaJkNxkcG-2DAe74tNhrE2eN2A,3222
|
@@ -11,7 +11,7 @@ isaacus/_resource.py,sha256=iP_oYhz5enCI58mK7hlwLoPMPh4Q5s8-KBv-jGfv2aM,1106
|
|
11
11
|
isaacus/_response.py,sha256=5v-mAgiP6X9EBGBvTYVdwuDjikiha-dc1dYmadIraCU,28795
|
12
12
|
isaacus/_streaming.py,sha256=tMBfwrfEFWm0v7vWFgjn_lizsoD70lPkYigIBuADaCM,10104
|
13
13
|
isaacus/_types.py,sha256=WCRAb8jikEJoOi8nza8l5NnOTKgZlpmN5fkiHoKoY08,6144
|
14
|
-
isaacus/_version.py,sha256=
|
14
|
+
isaacus/_version.py,sha256=lrZSgvq8RF7Q1bFXCHyRo1dSWktXcDOtoYEDDxxNP_8,159
|
15
15
|
isaacus/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
16
16
|
isaacus/_utils/__init__.py,sha256=PNZ_QJuzZEgyYXqkO1HVhGkj5IU9bglVUcw7H-Knjzw,2062
|
17
17
|
isaacus/_utils/_logs.py,sha256=rwa1Yzjbs2JaFn9KQ06rH5c_GSNa--BVwWnWhvvT1tY,777
|
@@ -23,15 +23,18 @@ isaacus/_utils/_transform.py,sha256=asrbdx4Pf5NupzaB8QdEjypW_DgHjjkpswHT0Jum4S0,
|
|
23
23
|
isaacus/_utils/_typing.py,sha256=nTJz0jcrQbEgxwy4TtAkNxuU0QHHlmc6mQtA6vIR8tg,4501
|
24
24
|
isaacus/_utils/_utils.py,sha256=8UmbPOy_AAr2uUjjFui-VZSrVBHRj6bfNEKRp5YZP2A,12004
|
25
25
|
isaacus/lib/.keep,sha256=wuNrz-5SXo3jJaJOJgz4vFHM41YH_g20F5cRQo0vLes,224
|
26
|
-
isaacus/resources/__init__.py,sha256=
|
26
|
+
isaacus/resources/__init__.py,sha256=N582fDHPnidiDhuxYlHKV_Io6WDNMI3HE8Yze3l8wqU,1171
|
27
|
+
isaacus/resources/rerankings.py,sha256=rNVu33jDe-KxaXKS9ReyPrvSYUIbTfxVRMm8MoZc9uI,11187
|
27
28
|
isaacus/resources/classifications/__init__.py,sha256=tYSnDm-o0CVuTC95VoNJzOqHsb8jTzYmW8hdwW14K60,1158
|
28
29
|
isaacus/resources/classifications/classifications.py,sha256=Td5Gscg1PNJJeobxow_hJq_RicpFe3ibEYN0Gh3Kpsg,4018
|
29
30
|
isaacus/resources/classifications/universal.py,sha256=bA577ocisYb_xS4OA53pM8ZITFprgbL7Wl6ruBqkccE,10656
|
30
|
-
isaacus/types/__init__.py,sha256=
|
31
|
+
isaacus/types/__init__.py,sha256=PswomxWpSak5TApm_28hneqI_l_g0-4NF5W6kdedI0Y,253
|
32
|
+
isaacus/types/reranking.py,sha256=MQRUoH2UB185Q369H01jnvaT9pz4D9z0oOoz8oLMqjc,911
|
33
|
+
isaacus/types/reranking_create_params.py,sha256=qJlXHbt4CxlBmdDpmqLC_VJ9ldTHBy4kxr1IwXxq4Es,2481
|
31
34
|
isaacus/types/classifications/__init__.py,sha256=GX6WFRzjx9qcuJhdRZjFLJRYMM4d5J8F5N-BUq4ZgP0,296
|
32
35
|
isaacus/types/classifications/universal_classification.py,sha256=Dmh03lcEzb5atmmdhNs99kPX9HQ1B_BaNKUojxu2nlA,1654
|
33
36
|
isaacus/types/classifications/universal_create_params.py,sha256=fFhx7SfLPA36lwCYPEzrW2jr7hFlSFyVPqBzNcHXQ2w,2259
|
34
|
-
isaacus-0.3.
|
35
|
-
isaacus-0.3.
|
36
|
-
isaacus-0.3.
|
37
|
-
isaacus-0.3.
|
37
|
+
isaacus-0.3.2.dist-info/METADATA,sha256=0WtxLj3xaSQs_bI2-h2c67VQweIan0DZugMAPTkOAEo,14296
|
38
|
+
isaacus-0.3.2.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
39
|
+
isaacus-0.3.2.dist-info/licenses/LICENSE,sha256=lUen4LYVFVGEVXBsntBAPsQsOWgMkno1e9WfgWkpZ-k,11337
|
40
|
+
isaacus-0.3.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|