isaacus 0.3.2__py3-none-any.whl → 0.4.0__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/_base_client.py CHANGED
@@ -98,7 +98,11 @@ _StreamT = TypeVar("_StreamT", bound=Stream[Any])
98
98
  _AsyncStreamT = TypeVar("_AsyncStreamT", bound=AsyncStream[Any])
99
99
 
100
100
  if TYPE_CHECKING:
101
- from httpx._config import DEFAULT_TIMEOUT_CONFIG as HTTPX_DEFAULT_TIMEOUT
101
+ from httpx._config import (
102
+ DEFAULT_TIMEOUT_CONFIG, # pyright: ignore[reportPrivateImportUsage]
103
+ )
104
+
105
+ HTTPX_DEFAULT_TIMEOUT = DEFAULT_TIMEOUT_CONFIG
102
106
  else:
103
107
  try:
104
108
  from httpx._config import DEFAULT_TIMEOUT_CONFIG as HTTPX_DEFAULT_TIMEOUT
@@ -409,7 +413,8 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
409
413
 
410
414
  idempotency_header = self._idempotency_header
411
415
  if idempotency_header and options.method.lower() != "get" and idempotency_header not in headers:
412
- headers[idempotency_header] = options.idempotency_key or self._idempotency_key()
416
+ options.idempotency_key = options.idempotency_key or self._idempotency_key()
417
+ headers[idempotency_header] = options.idempotency_key
413
418
 
414
419
  # Don't set these headers if they were already set or removed by the caller. We check
415
420
  # `custom_headers`, which can contain `Omit()`, instead of `headers` to account for the removal case.
@@ -943,6 +948,10 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
943
948
  request = self._build_request(options, retries_taken=retries_taken)
944
949
  self._prepare_request(request)
945
950
 
951
+ if options.idempotency_key:
952
+ # ensure the idempotency key is reused between requests
953
+ input_options.idempotency_key = options.idempotency_key
954
+
946
955
  kwargs: HttpxSendArgs = {}
947
956
  if self.custom_auth is not None:
948
957
  kwargs["auth"] = self.custom_auth
@@ -1475,6 +1484,10 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
1475
1484
  request = self._build_request(options, retries_taken=retries_taken)
1476
1485
  await self._prepare_request(request)
1477
1486
 
1487
+ if options.idempotency_key:
1488
+ # ensure the idempotency key is reused between requests
1489
+ input_options.idempotency_key = options.idempotency_key
1490
+
1478
1491
  kwargs: HttpxSendArgs = {}
1479
1492
  if self.custom_auth is not None:
1480
1493
  kwargs["auth"] = self.custom_auth
isaacus/_models.py CHANGED
@@ -19,7 +19,6 @@ from typing_extensions import (
19
19
  )
20
20
 
21
21
  import pydantic
22
- import pydantic.generics
23
22
  from pydantic.fields import FieldInfo
24
23
 
25
24
  from ._types import (
@@ -5,13 +5,15 @@ import base64
5
5
  import pathlib
6
6
  from typing import Any, Mapping, TypeVar, cast
7
7
  from datetime import date, datetime
8
- from typing_extensions import Literal, get_args, override, get_type_hints
8
+ from typing_extensions import Literal, get_args, override, get_type_hints as _get_type_hints
9
9
 
10
10
  import anyio
11
11
  import pydantic
12
12
 
13
13
  from ._utils import (
14
14
  is_list,
15
+ is_given,
16
+ lru_cache,
15
17
  is_mapping,
16
18
  is_iterable,
17
19
  )
@@ -108,6 +110,7 @@ def transform(
108
110
  return cast(_T, transformed)
109
111
 
110
112
 
113
+ @lru_cache(maxsize=8096)
111
114
  def _get_annotated_type(type_: type) -> type | None:
112
115
  """If the given type is an `Annotated` type then it is returned, if not `None` is returned.
113
116
 
@@ -142,6 +145,10 @@ def _maybe_transform_key(key: str, type_: type) -> str:
142
145
  return key
143
146
 
144
147
 
148
+ def _no_transform_needed(annotation: type) -> bool:
149
+ return annotation == float or annotation == int
150
+
151
+
145
152
  def _transform_recursive(
146
153
  data: object,
147
154
  *,
@@ -184,6 +191,15 @@ def _transform_recursive(
184
191
  return cast(object, data)
185
192
 
186
193
  inner_type = extract_type_arg(stripped_type, 0)
194
+ if _no_transform_needed(inner_type):
195
+ # for some types there is no need to transform anything, so we can get a small
196
+ # perf boost from skipping that work.
197
+ #
198
+ # but we still need to convert to a list to ensure the data is json-serializable
199
+ if is_list(data):
200
+ return data
201
+ return list(data)
202
+
187
203
  return [_transform_recursive(d, annotation=annotation, inner_type=inner_type) for d in data]
188
204
 
189
205
  if is_union_type(stripped_type):
@@ -245,6 +261,11 @@ def _transform_typeddict(
245
261
  result: dict[str, object] = {}
246
262
  annotations = get_type_hints(expected_type, include_extras=True)
247
263
  for key, value in data.items():
264
+ if not is_given(value):
265
+ # we don't need to include `NotGiven` values here as they'll
266
+ # be stripped out before the request is sent anyway
267
+ continue
268
+
248
269
  type_ = annotations.get(key)
249
270
  if type_ is None:
250
271
  # we do not have a type annotation for this field, leave it as is
@@ -332,6 +353,15 @@ async def _async_transform_recursive(
332
353
  return cast(object, data)
333
354
 
334
355
  inner_type = extract_type_arg(stripped_type, 0)
356
+ if _no_transform_needed(inner_type):
357
+ # for some types there is no need to transform anything, so we can get a small
358
+ # perf boost from skipping that work.
359
+ #
360
+ # but we still need to convert to a list to ensure the data is json-serializable
361
+ if is_list(data):
362
+ return data
363
+ return list(data)
364
+
335
365
  return [await _async_transform_recursive(d, annotation=annotation, inner_type=inner_type) for d in data]
336
366
 
337
367
  if is_union_type(stripped_type):
@@ -393,6 +423,11 @@ async def _async_transform_typeddict(
393
423
  result: dict[str, object] = {}
394
424
  annotations = get_type_hints(expected_type, include_extras=True)
395
425
  for key, value in data.items():
426
+ if not is_given(value):
427
+ # we don't need to include `NotGiven` values here as they'll
428
+ # be stripped out before the request is sent anyway
429
+ continue
430
+
396
431
  type_ = annotations.get(key)
397
432
  if type_ is None:
398
433
  # we do not have a type annotation for this field, leave it as is
@@ -400,3 +435,13 @@ async def _async_transform_typeddict(
400
435
  else:
401
436
  result[_maybe_transform_key(key, type_)] = await _async_transform_recursive(value, annotation=type_)
402
437
  return result
438
+
439
+
440
+ @lru_cache(maxsize=8096)
441
+ def get_type_hints(
442
+ obj: Any,
443
+ globalns: dict[str, Any] | None = None,
444
+ localns: Mapping[str, Any] | None = None,
445
+ include_extras: bool = False,
446
+ ) -> dict[str, Any]:
447
+ return _get_type_hints(obj, globalns=globalns, localns=localns, include_extras=include_extras)
isaacus/_utils/_typing.py CHANGED
@@ -13,6 +13,7 @@ from typing_extensions import (
13
13
  get_origin,
14
14
  )
15
15
 
16
+ from ._utils import lru_cache
16
17
  from .._types import InheritsGeneric
17
18
  from .._compat import is_union as _is_union
18
19
 
@@ -66,6 +67,7 @@ def is_type_alias_type(tp: Any, /) -> TypeIs[typing_extensions.TypeAliasType]:
66
67
 
67
68
 
68
69
  # Extracts T from Annotated[T, ...] or from Required[Annotated[T, ...]]
70
+ @lru_cache(maxsize=8096)
69
71
  def strip_annotated_type(typ: type) -> type:
70
72
  if is_required_type(typ) or is_annotated_type(typ):
71
73
  return strip_annotated_type(cast(type, get_args(typ)[0]))
@@ -108,7 +110,7 @@ def extract_type_var_from_base(
108
110
  ```
109
111
  """
110
112
  cls = cast(object, get_origin(typ) or typ)
111
- if cls in generic_bases:
113
+ if cls in generic_bases: # pyright: ignore[reportUnnecessaryContains]
112
114
  # we're given the class directly
113
115
  return extract_type_arg(typ, index)
114
116
 
isaacus/_version.py CHANGED
@@ -1,4 +1,4 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  __title__ = "isaacus"
4
- __version__ = "0.3.2" # x-release-please-version
4
+ __version__ = "0.4.0" # x-release-please-version
@@ -2,7 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import Optional
5
+ from typing import List, Optional
6
6
  from typing_extensions import Literal
7
7
 
8
8
  import httpx
@@ -52,7 +52,7 @@ class UniversalResource(SyncAPIResource):
52
52
  *,
53
53
  model: Literal["kanon-universal-classifier", "kanon-universal-classifier-mini"],
54
54
  query: str,
55
- text: str,
55
+ texts: List[str],
56
56
  chunking_options: Optional[universal_create_params.ChunkingOptions] | NotGiven = NOT_GIVEN,
57
57
  is_iql: bool | NotGiven = NOT_GIVEN,
58
58
  scoring_method: Literal["auto", "chunk_max", "chunk_avg", "chunk_min"] | NotGiven = NOT_GIVEN,
@@ -64,7 +64,7 @@ class UniversalResource(SyncAPIResource):
64
64
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
65
65
  ) -> UniversalClassification:
66
66
  """
67
- Classify the relevance of a legal document to a query with an Isaacus universal
67
+ Classify the relevance of legal documents to a query with an Isaacus universal
68
68
  legal AI classifier.
69
69
 
70
70
  Args:
@@ -72,16 +72,16 @@ class UniversalResource(SyncAPIResource):
72
72
  to use for universal classification.
73
73
 
74
74
  query: The [Isaacus Query Language (IQL)](https://docs.isaacus.com/iql) query or, if
75
- IQL is disabled, the statement, to evaluate the text against.
75
+ IQL is disabled, the statement, to evaluate the texts against.
76
76
 
77
77
  The query must contain at least one non-whitespace character.
78
78
 
79
- Unlike the text being classified, the query cannot be so long that it exceeds
79
+ Unlike the texts being classified, the query cannot be so long that it exceeds
80
80
  the maximum input length of the universal classifier.
81
81
 
82
- text: The text to classify.
82
+ texts: The texts to classify.
83
83
 
84
- The text must contain at least one non-whitespace character.
84
+ The texts must contain at least one non-whitespace character.
85
85
 
86
86
  chunking_options: Options for how to split text into smaller chunks.
87
87
 
@@ -92,13 +92,13 @@ class UniversalResource(SyncAPIResource):
92
92
 
93
93
  `auto` is the default scoring method and is recommended for most use cases.
94
94
  Currently, it is equivalent to `chunk_max`. In the future, it will automatically
95
- select the best method based on the model and input.
95
+ select the best method based on the model and inputs.
96
96
 
97
- `chunk_max` uses the highest confidence score of all of the text's chunks.
97
+ `chunk_max` uses the highest confidence score of all of the texts' chunks.
98
98
 
99
- `chunk_avg` averages the confidence scores of all of the text's chunks.
99
+ `chunk_avg` averages the confidence scores of all of the texts' chunks.
100
100
 
101
- `chunk_min` uses the lowest confidence score of all of the text's chunks.
101
+ `chunk_min` uses the lowest confidence score of all of the texts' chunks.
102
102
 
103
103
  extra_headers: Send extra headers
104
104
 
@@ -114,7 +114,7 @@ class UniversalResource(SyncAPIResource):
114
114
  {
115
115
  "model": model,
116
116
  "query": query,
117
- "text": text,
117
+ "texts": texts,
118
118
  "chunking_options": chunking_options,
119
119
  "is_iql": is_iql,
120
120
  "scoring_method": scoring_method,
@@ -153,7 +153,7 @@ class AsyncUniversalResource(AsyncAPIResource):
153
153
  *,
154
154
  model: Literal["kanon-universal-classifier", "kanon-universal-classifier-mini"],
155
155
  query: str,
156
- text: str,
156
+ texts: List[str],
157
157
  chunking_options: Optional[universal_create_params.ChunkingOptions] | NotGiven = NOT_GIVEN,
158
158
  is_iql: bool | NotGiven = NOT_GIVEN,
159
159
  scoring_method: Literal["auto", "chunk_max", "chunk_avg", "chunk_min"] | NotGiven = NOT_GIVEN,
@@ -165,7 +165,7 @@ class AsyncUniversalResource(AsyncAPIResource):
165
165
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
166
166
  ) -> UniversalClassification:
167
167
  """
168
- Classify the relevance of a legal document to a query with an Isaacus universal
168
+ Classify the relevance of legal documents to a query with an Isaacus universal
169
169
  legal AI classifier.
170
170
 
171
171
  Args:
@@ -173,16 +173,16 @@ class AsyncUniversalResource(AsyncAPIResource):
173
173
  to use for universal classification.
174
174
 
175
175
  query: The [Isaacus Query Language (IQL)](https://docs.isaacus.com/iql) query or, if
176
- IQL is disabled, the statement, to evaluate the text against.
176
+ IQL is disabled, the statement, to evaluate the texts against.
177
177
 
178
178
  The query must contain at least one non-whitespace character.
179
179
 
180
- Unlike the text being classified, the query cannot be so long that it exceeds
180
+ Unlike the texts being classified, the query cannot be so long that it exceeds
181
181
  the maximum input length of the universal classifier.
182
182
 
183
- text: The text to classify.
183
+ texts: The texts to classify.
184
184
 
185
- The text must contain at least one non-whitespace character.
185
+ The texts must contain at least one non-whitespace character.
186
186
 
187
187
  chunking_options: Options for how to split text into smaller chunks.
188
188
 
@@ -193,13 +193,13 @@ class AsyncUniversalResource(AsyncAPIResource):
193
193
 
194
194
  `auto` is the default scoring method and is recommended for most use cases.
195
195
  Currently, it is equivalent to `chunk_max`. In the future, it will automatically
196
- select the best method based on the model and input.
196
+ select the best method based on the model and inputs.
197
197
 
198
- `chunk_max` uses the highest confidence score of all of the text's chunks.
198
+ `chunk_max` uses the highest confidence score of all of the texts' chunks.
199
199
 
200
- `chunk_avg` averages the confidence scores of all of the text's chunks.
200
+ `chunk_avg` averages the confidence scores of all of the texts' chunks.
201
201
 
202
- `chunk_min` uses the lowest confidence score of all of the text's chunks.
202
+ `chunk_min` uses the lowest confidence score of all of the texts' chunks.
203
203
 
204
204
  extra_headers: Send extra headers
205
205
 
@@ -215,7 +215,7 @@ class AsyncUniversalResource(AsyncAPIResource):
215
215
  {
216
216
  "model": model,
217
217
  "query": query,
218
- "text": text,
218
+ "texts": texts,
219
219
  "chunking_options": chunking_options,
220
220
  "is_iql": is_iql,
221
221
  "scoring_method": scoring_method,
@@ -4,15 +4,22 @@ from typing import List, Optional
4
4
 
5
5
  from ..._models import BaseModel
6
6
 
7
- __all__ = ["UniversalClassification", "Chunk", "Usage"]
7
+ __all__ = ["UniversalClassification", "Classification", "ClassificationChunk", "Usage"]
8
8
 
9
9
 
10
- class Chunk(BaseModel):
10
+ class ClassificationChunk(BaseModel):
11
11
  end: int
12
- """The end index of the chunk in the original text."""
12
+ """
13
+ The index of the character in the original text where the chunk ends, beginning
14
+ from `0` (such that, in Python, the chunk is equivalent to `text[start:end+1]`).
15
+ """
13
16
 
14
17
  index: int
15
- """The index of the chunk in the list of chunks."""
18
+ """
19
+ The original position of the chunk in the outputted list of chunks before
20
+ sorting, starting from `0` (and, therefore, ending at the number of chunks minus
21
+ `1`).
22
+ """
16
23
 
17
24
  score: float
18
25
  """
@@ -24,19 +31,17 @@ class Chunk(BaseModel):
24
31
  """
25
32
 
26
33
  start: int
27
- """The start index of the chunk in the original text."""
34
+ """
35
+ The index of the character in the original text where the chunk starts,
36
+ beginning from `0`.
37
+ """
28
38
 
29
39
  text: str
30
40
  """The text of the chunk."""
31
41
 
32
42
 
33
- class Usage(BaseModel):
34
- input_tokens: int
35
- """The number of tokens inputted to the model."""
36
-
37
-
38
- class UniversalClassification(BaseModel):
39
- chunks: Optional[List[Chunk]] = None
43
+ class Classification(BaseModel):
44
+ chunks: Optional[List[ClassificationChunk]] = None
40
45
  """
41
46
  The text as broken into chunks by
42
47
  [semchunk](https://github.com/isaacus-dev/semchunk), each chunk with its own
@@ -45,6 +50,12 @@ class UniversalClassification(BaseModel):
45
50
  If no chunking occurred, this will be `null`.
46
51
  """
47
52
 
53
+ index: int
54
+ """
55
+ The index of the text in the input array of texts, starting from `0` (and,
56
+ therefore, ending at the number of texts minus `1`).
57
+ """
58
+
48
59
  score: float
49
60
  """
50
61
  A score of the likelihood that the query expressed about the text is supported
@@ -54,5 +65,18 @@ class UniversalClassification(BaseModel):
54
65
  score less than `0.5` indicates that the text does not support the query.
55
66
  """
56
67
 
68
+
69
+ class Usage(BaseModel):
70
+ input_tokens: int
71
+ """The number of tokens inputted to the model."""
72
+
73
+
74
+ class UniversalClassification(BaseModel):
75
+ classifications: List[Classification]
76
+ """
77
+ The classifications of the texts, by relevance to the query, in order from
78
+ highest to lowest relevance score.
79
+ """
80
+
57
81
  usage: Usage
58
82
  """Statistics about the usage of resources in the process of classifying the text."""
@@ -2,7 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import Optional
5
+ from typing import List, Optional
6
6
  from typing_extensions import Literal, Required, TypedDict
7
7
 
8
8
  __all__ = ["UniversalCreateParams", "ChunkingOptions"]
@@ -18,18 +18,18 @@ class UniversalCreateParams(TypedDict, total=False):
18
18
  query: Required[str]
19
19
  """
20
20
  The [Isaacus Query Language (IQL)](https://docs.isaacus.com/iql) query or, if
21
- IQL is disabled, the statement, to evaluate the text against.
21
+ IQL is disabled, the statement, to evaluate the texts against.
22
22
 
23
23
  The query must contain at least one non-whitespace character.
24
24
 
25
- Unlike the text being classified, the query cannot be so long that it exceeds
25
+ Unlike the texts being classified, the query cannot be so long that it exceeds
26
26
  the maximum input length of the universal classifier.
27
27
  """
28
28
 
29
- text: Required[str]
30
- """The text to classify.
29
+ texts: Required[List[str]]
30
+ """The texts to classify.
31
31
 
32
- The text must contain at least one non-whitespace character.
32
+ The texts must contain at least one non-whitespace character.
33
33
  """
34
34
 
35
35
  chunking_options: Optional[ChunkingOptions]
@@ -46,13 +46,13 @@ class UniversalCreateParams(TypedDict, total=False):
46
46
 
47
47
  `auto` is the default scoring method and is recommended for most use cases.
48
48
  Currently, it is equivalent to `chunk_max`. In the future, it will automatically
49
- select the best method based on the model and input.
49
+ select the best method based on the model and inputs.
50
50
 
51
- `chunk_max` uses the highest confidence score of all of the text's chunks.
51
+ `chunk_max` uses the highest confidence score of all of the texts' chunks.
52
52
 
53
- `chunk_avg` averages the confidence scores of all of the text's chunks.
53
+ `chunk_avg` averages the confidence scores of all of the texts' chunks.
54
54
 
55
- `chunk_min` uses the lowest confidence score of all of the text's chunks.
55
+ `chunk_min` uses the lowest confidence score of all of the texts' chunks.
56
56
  """
57
57
 
58
58
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: isaacus
3
- Version: 0.3.2
3
+ Version: 0.4.0
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
@@ -65,9 +65,9 @@ client = Isaacus(
65
65
  universal_classification = client.classifications.universal.create(
66
66
  model="kanon-universal-classifier",
67
67
  query="This is a confidentiality clause.",
68
- text="I agree not to tell anyone about the document.",
68
+ texts=["I agree not to tell anyone about the document."],
69
69
  )
70
- print(universal_classification.chunks)
70
+ print(universal_classification.classifications)
71
71
  ```
72
72
 
73
73
  While you can provide an `api_key` keyword argument,
@@ -93,9 +93,9 @@ async def main() -> None:
93
93
  universal_classification = await client.classifications.universal.create(
94
94
  model="kanon-universal-classifier",
95
95
  query="This is a confidentiality clause.",
96
- text="I agree not to tell anyone about the document.",
96
+ texts=["I agree not to tell anyone about the document."],
97
97
  )
98
- print(universal_classification.chunks)
98
+ print(universal_classification.classifications)
99
99
 
100
100
 
101
101
  asyncio.run(main())
@@ -124,7 +124,7 @@ client = Isaacus()
124
124
  universal_classification = client.classifications.universal.create(
125
125
  model="kanon-universal-classifier",
126
126
  query="This is a confidentiality clause.",
127
- text="I agree not to tell anyone about the document.",
127
+ texts=["I agree not to tell anyone about the document."],
128
128
  chunking_options={
129
129
  "overlap_ratio": 0.1,
130
130
  "overlap_tokens": None,
@@ -153,7 +153,7 @@ try:
153
153
  client.classifications.universal.create(
154
154
  model="kanon-universal-classifier",
155
155
  query="This is a confidentiality clause.",
156
- text="I agree not to tell anyone about the document.",
156
+ texts=["I agree not to tell anyone about the document."],
157
157
  )
158
158
  except isaacus.APIConnectionError as e:
159
159
  print("The server could not be reached")
@@ -200,7 +200,7 @@ client = Isaacus(
200
200
  client.with_options(max_retries=5).classifications.universal.create(
201
201
  model="kanon-universal-classifier",
202
202
  query="This is a confidentiality clause.",
203
- text="I agree not to tell anyone about the document.",
203
+ texts=["I agree not to tell anyone about the document."],
204
204
  )
205
205
  ```
206
206
 
@@ -227,7 +227,7 @@ client = Isaacus(
227
227
  client.with_options(timeout=5.0).classifications.universal.create(
228
228
  model="kanon-universal-classifier",
229
229
  query="This is a confidentiality clause.",
230
- text="I agree not to tell anyone about the document.",
230
+ texts=["I agree not to tell anyone about the document."],
231
231
  )
232
232
  ```
233
233
 
@@ -272,12 +272,12 @@ client = Isaacus()
272
272
  response = client.classifications.universal.with_raw_response.create(
273
273
  model="kanon-universal-classifier",
274
274
  query="This is a confidentiality clause.",
275
- text="I agree not to tell anyone about the document.",
275
+ texts=["I agree not to tell anyone about the document."],
276
276
  )
277
277
  print(response.headers.get('X-My-Header'))
278
278
 
279
279
  universal = response.parse() # get the object that `classifications.universal.create()` would have returned
280
- print(universal.chunks)
280
+ print(universal.classifications)
281
281
  ```
282
282
 
283
283
  These methods return an [`APIResponse`](https://github.com/isaacus-dev/isaacus-python/tree/main/src/isaacus/_response.py) object.
@@ -294,7 +294,7 @@ To stream the response body, use `.with_streaming_response` instead, which requi
294
294
  with client.classifications.universal.with_streaming_response.create(
295
295
  model="kanon-universal-classifier",
296
296
  query="This is a confidentiality clause.",
297
- text="I agree not to tell anyone about the document.",
297
+ texts=["I agree not to tell anyone about the document."],
298
298
  ) as response:
299
299
  print(response.headers.get("X-My-Header"))
300
300
 
@@ -1,17 +1,17 @@
1
1
  isaacus/__init__.py,sha256=Wgs-qjblN9tJvI22iWwi5CfiVvyn1drBPnTYhVj7cWk,2426
2
- isaacus/_base_client.py,sha256=ORZD1WjSTLicI9Bv0nJdIF7OGDv0Wl4ySK0ygQ9AjM8,64958
2
+ isaacus/_base_client.py,sha256=f8PpKwJ8YPyCeeBMSa71foqa9INVBTKqwRAwYRGIEq8,65455
3
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
7
7
  isaacus/_files.py,sha256=mf4dOgL4b0ryyZlbqLhggD3GVgDf6XxdGFAgce01ugE,3549
8
- isaacus/_models.py,sha256=Bg-k8-T1kDWURAYXrbDF5FSAyLEy7k90Jrvne-dF4Wc,29070
8
+ isaacus/_models.py,sha256=q-l1tes71l6z-D5ffu9-G4UigTVVeJwiwIzA_gO4RFo,29045
9
9
  isaacus/_qs.py,sha256=AOkSz4rHtK4YI3ZU_kzea-zpwBUgEY8WniGmTPyEimc,4846
10
10
  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=lrZSgvq8RF7Q1bFXCHyRo1dSWktXcDOtoYEDDxxNP_8,159
14
+ isaacus/_version.py,sha256=06QioXWDQ11nTTToShF6qU2flviCnzOdpUbozg388AU,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
@@ -19,22 +19,22 @@ isaacus/_utils/_proxy.py,sha256=z3zsateHtb0EARTWKk8QZNHfPkqJbqwd1lM993LBwGE,1902
19
19
  isaacus/_utils/_reflection.py,sha256=ZmGkIgT_PuwedyNBrrKGbxoWtkpytJNU1uU4QHnmEMU,1364
20
20
  isaacus/_utils/_streams.py,sha256=SMC90diFFecpEg_zgDRVbdR3hSEIgVVij4taD-noMLM,289
21
21
  isaacus/_utils/_sync.py,sha256=TpGLrrhRNWTJtODNE6Fup3_k7zrWm1j2RlirzBwre-0,2862
22
- isaacus/_utils/_transform.py,sha256=asrbdx4Pf5NupzaB8QdEjypW_DgHjjkpswHT0Jum4S0,13987
23
- isaacus/_utils/_typing.py,sha256=nTJz0jcrQbEgxwy4TtAkNxuU0QHHlmc6mQtA6vIR8tg,4501
22
+ isaacus/_utils/_transform.py,sha256=n7kskEWz6o__aoNvhFoGVyDoalNe6mJwp-g7BWkdj88,15617
23
+ isaacus/_utils/_typing.py,sha256=D0DbbNu8GnYQTSICnTSHDGsYXj8TcAKyhejb0XcnjtY,4602
24
24
  isaacus/_utils/_utils.py,sha256=8UmbPOy_AAr2uUjjFui-VZSrVBHRj6bfNEKRp5YZP2A,12004
25
25
  isaacus/lib/.keep,sha256=wuNrz-5SXo3jJaJOJgz4vFHM41YH_g20F5cRQo0vLes,224
26
26
  isaacus/resources/__init__.py,sha256=N582fDHPnidiDhuxYlHKV_Io6WDNMI3HE8Yze3l8wqU,1171
27
27
  isaacus/resources/rerankings.py,sha256=rNVu33jDe-KxaXKS9ReyPrvSYUIbTfxVRMm8MoZc9uI,11187
28
28
  isaacus/resources/classifications/__init__.py,sha256=tYSnDm-o0CVuTC95VoNJzOqHsb8jTzYmW8hdwW14K60,1158
29
29
  isaacus/resources/classifications/classifications.py,sha256=Td5Gscg1PNJJeobxow_hJq_RicpFe3ibEYN0Gh3Kpsg,4018
30
- isaacus/resources/classifications/universal.py,sha256=bA577ocisYb_xS4OA53pM8ZITFprgbL7Wl6ruBqkccE,10656
30
+ isaacus/resources/classifications/universal.py,sha256=KEBH6BXeD3BvIWY_IlcC7373Qzl7yN8dJxbsnYcyvKA,10690
31
31
  isaacus/types/__init__.py,sha256=PswomxWpSak5TApm_28hneqI_l_g0-4NF5W6kdedI0Y,253
32
32
  isaacus/types/reranking.py,sha256=MQRUoH2UB185Q369H01jnvaT9pz4D9z0oOoz8oLMqjc,911
33
33
  isaacus/types/reranking_create_params.py,sha256=qJlXHbt4CxlBmdDpmqLC_VJ9ldTHBy4kxr1IwXxq4Es,2481
34
34
  isaacus/types/classifications/__init__.py,sha256=GX6WFRzjx9qcuJhdRZjFLJRYMM4d5J8F5N-BUq4ZgP0,296
35
- isaacus/types/classifications/universal_classification.py,sha256=Dmh03lcEzb5atmmdhNs99kPX9HQ1B_BaNKUojxu2nlA,1654
36
- isaacus/types/classifications/universal_create_params.py,sha256=fFhx7SfLPA36lwCYPEzrW2jr7hFlSFyVPqBzNcHXQ2w,2259
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,,
35
+ isaacus/types/classifications/universal_classification.py,sha256=mUFxIWGiZ0IjTh9eHSgUtdjBpVBHc187z-XmZPkx8cc,2407
36
+ isaacus/types/classifications/universal_create_params.py,sha256=yacdNfTCgkQhXtdd_fim1YqNCRMEoRL5aKCtbJCQhTk,2277
37
+ isaacus-0.4.0.dist-info/METADATA,sha256=qnzPZvp1R-jcKeK8JvJBjPLnC547aje3v08z-umQOGc,14347
38
+ isaacus-0.4.0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
39
+ isaacus-0.4.0.dist-info/licenses/LICENSE,sha256=lUen4LYVFVGEVXBsntBAPsQsOWgMkno1e9WfgWkpZ-k,11337
40
+ isaacus-0.4.0.dist-info/RECORD,,