isaacus 0.1.3__py3-none-any.whl → 0.1.6__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/_models.py CHANGED
@@ -65,7 +65,7 @@ from ._compat import (
65
65
  from ._constants import RAW_RESPONSE_HEADER
66
66
 
67
67
  if TYPE_CHECKING:
68
- from pydantic_core.core_schema import ModelField, LiteralSchema, ModelFieldsSchema
68
+ from pydantic_core.core_schema import ModelField, ModelSchema, LiteralSchema, ModelFieldsSchema
69
69
 
70
70
  __all__ = ["BaseModel", "GenericModel"]
71
71
 
@@ -646,15 +646,18 @@ def _build_discriminated_union_meta(*, union: type, meta_annotations: tuple[Any,
646
646
 
647
647
  def _extract_field_schema_pv2(model: type[BaseModel], field_name: str) -> ModelField | None:
648
648
  schema = model.__pydantic_core_schema__
649
+ if schema["type"] == "definitions":
650
+ schema = schema["schema"]
651
+
649
652
  if schema["type"] != "model":
650
653
  return None
651
654
 
655
+ schema = cast("ModelSchema", schema)
652
656
  fields_schema = schema["schema"]
653
657
  if fields_schema["type"] != "model-fields":
654
658
  return None
655
659
 
656
660
  fields_schema = cast("ModelFieldsSchema", fields_schema)
657
-
658
661
  field = fields_schema["fields"].get(field_name)
659
662
  if not field:
660
663
  return None
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.1.3" # x-release-please-version
4
+ __version__ = "0.1.6" # x-release-please-version
@@ -68,10 +68,11 @@ class UniversalResource(SyncAPIResource):
68
68
  legal AI classifier.
69
69
 
70
70
  Args:
71
- model: The ID of the model to use for universal classification.
71
+ model: The ID of the [model](https://docs.isaacus.com/models#universal-classification)
72
+ to use for universal classification.
72
73
 
73
- query: The Isaacus Query Language (IQL) query or, if IQL is disabled, the statement, to
74
- evaluate the text against.
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
76
 
76
77
  The query must contain at least one non-whitespace character.
77
78
 
@@ -84,8 +85,8 @@ class UniversalResource(SyncAPIResource):
84
85
 
85
86
  chunking_options: Options for how to split text into smaller chunks.
86
87
 
87
- is_iql: Whether the query should be interpreted as an Isaacus Query Language (IQL) query
88
- or else as a statement.
88
+ is_iql: Whether the query should be interpreted as an
89
+ [IQL](https://docs.isaacus.com/iql) query or else as a statement.
89
90
 
90
91
  scoring_method: The method to use for producing an overall confidence score.
91
92
 
@@ -168,10 +169,11 @@ class AsyncUniversalResource(AsyncAPIResource):
168
169
  legal AI classifier.
169
170
 
170
171
  Args:
171
- model: The ID of the model to use for universal classification.
172
+ model: The ID of the [model](https://docs.isaacus.com/models#universal-classification)
173
+ to use for universal classification.
172
174
 
173
- query: The Isaacus Query Language (IQL) query or, if IQL is disabled, the statement, to
174
- evaluate the text against.
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.
175
177
 
176
178
  The query must contain at least one non-whitespace character.
177
179
 
@@ -184,8 +186,8 @@ class AsyncUniversalResource(AsyncAPIResource):
184
186
 
185
187
  chunking_options: Options for how to split text into smaller chunks.
186
188
 
187
- is_iql: Whether the query should be interpreted as an Isaacus Query Language (IQL) query
188
- or else as a statement.
189
+ is_iql: Whether the query should be interpreted as an
190
+ [IQL](https://docs.isaacus.com/iql) query or else as a statement.
189
191
 
190
192
  scoring_method: The method to use for producing an overall confidence score.
191
193
 
@@ -10,12 +10,15 @@ __all__ = ["UniversalCreateParams", "ChunkingOptions"]
10
10
 
11
11
  class UniversalCreateParams(TypedDict, total=False):
12
12
  model: Required[Literal["kanon-universal-classifier", "kanon-universal-classifier-mini"]]
13
- """The ID of the model to use for universal classification."""
13
+ """
14
+ The ID of the [model](https://docs.isaacus.com/models#universal-classification)
15
+ to use for universal classification.
16
+ """
14
17
 
15
18
  query: Required[str]
16
19
  """
17
- The Isaacus Query Language (IQL) query or, if IQL is disabled, the statement, to
18
- evaluate the text against.
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.
19
22
 
20
23
  The query must contain at least one non-whitespace character.
21
24
 
@@ -34,8 +37,8 @@ class UniversalCreateParams(TypedDict, total=False):
34
37
 
35
38
  is_iql: bool
36
39
  """
37
- Whether the query should be interpreted as an Isaacus Query Language (IQL) query
38
- or else as a statement.
40
+ Whether the query should be interpreted as an
41
+ [IQL](https://docs.isaacus.com/iql) query or else as a statement.
39
42
  """
40
43
 
41
44
  scoring_method: Literal["auto", "chunk_max", "chunk_avg", "chunk_min"]
@@ -1,12 +1,11 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.3
2
2
  Name: isaacus
3
- Version: 0.1.3
3
+ Version: 0.1.6
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
7
7
  Author-email: Isaacus <support@isaacus.com>
8
- License-Expression: Apache-2.0
9
- License-File: LICENSE
8
+ License: Apache-2.0
10
9
  Classifier: Intended Audience :: Developers
11
10
  Classifier: License :: OSI Approved :: Apache Software License
12
11
  Classifier: Operating System :: MacOS
@@ -128,7 +127,7 @@ universal_classification = client.classifications.universal.create(
128
127
  text="I agree not to tell anyone about the document.",
129
128
  chunking_options={
130
129
  "overlap_ratio": 0.1,
131
- "overlap_tokens": 0,
130
+ "overlap_tokens": None,
132
131
  "size": 512,
133
132
  },
134
133
  )
@@ -5,13 +5,13 @@ 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=PDLSNsn3Umxm3UMZPgyBiyN308rRzzPX6F9NO9FU2vs,28943
8
+ isaacus/_models.py,sha256=CTC-fpbbGneROztxHX-PkLntPt1ZMmwDqoKY9VAIOVg,29071
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=qN7YxJPmtC1GdfRAA4R4tC4RSJvgBbUJ3G2CSpmVny0,159
14
+ isaacus/_version.py,sha256=qN23mHLtV9W3LepsQ897Vl3V0xyDsm3NvLjZuBmHsSo,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
@@ -26,12 +26,12 @@ isaacus/lib/.keep,sha256=wuNrz-5SXo3jJaJOJgz4vFHM41YH_g20F5cRQo0vLes,224
26
26
  isaacus/resources/__init__.py,sha256=KjFBnZ_h6ej57WNjlTujjO7TMNC1wVbFNA19ryus-P4,669
27
27
  isaacus/resources/classifications/__init__.py,sha256=tYSnDm-o0CVuTC95VoNJzOqHsb8jTzYmW8hdwW14K60,1158
28
28
  isaacus/resources/classifications/classifications.py,sha256=Td5Gscg1PNJJeobxow_hJq_RicpFe3ibEYN0Gh3Kpsg,4018
29
- isaacus/resources/classifications/universal.py,sha256=pL3vaJPQry54drZRYdIeUVvsabJ9XzW-gUNSCXCpdQA,10432
29
+ isaacus/resources/classifications/universal.py,sha256=INLcguFLK9Vziu2MV8aFDilA3TFhtb2XjIE3c_-uaJs,10658
30
30
  isaacus/types/__init__.py,sha256=OKfJYcKb4NObdiRObqJV_dOyDQ8feXekDUge2o_4pXQ,122
31
31
  isaacus/types/classifications/__init__.py,sha256=GX6WFRzjx9qcuJhdRZjFLJRYMM4d5J8F5N-BUq4ZgP0,296
32
32
  isaacus/types/classifications/universal_classification.py,sha256=gyzkeQ5wII6w2CdbDrdMAFuRZSCJRRCIXecF-3h5OXQ,1544
33
- isaacus/types/classifications/universal_create_params.py,sha256=w_d4mS2-Mys750436STGVCjIGiw9TYEGALJ3E6lH-Kw,2146
34
- isaacus-0.1.3.dist-info/METADATA,sha256=2RwPmkyG5EeK0cv1fNmP_Q84IC1kVKwI7pivPCG_7oo,14326
35
- isaacus-0.1.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
36
- isaacus-0.1.3.dist-info/licenses/LICENSE,sha256=lUen4LYVFVGEVXBsntBAPsQsOWgMkno1e9WfgWkpZ-k,11337
37
- isaacus-0.1.3.dist-info/RECORD,,
33
+ isaacus/types/classifications/universal_create_params.py,sha256=fFhx7SfLPA36lwCYPEzrW2jr7hFlSFyVPqBzNcHXQ2w,2259
34
+ isaacus-0.1.6.dist-info/METADATA,sha256=8sO3CYIG0V20Q8M7aXZHo0OSZmda9y5q7uwy20qTszo,14296
35
+ isaacus-0.1.6.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
36
+ isaacus-0.1.6.dist-info/licenses/LICENSE,sha256=lUen4LYVFVGEVXBsntBAPsQsOWgMkno1e9WfgWkpZ-k,11337
37
+ isaacus-0.1.6.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.27.0
2
+ Generator: hatchling 1.26.3
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any