isaacus 0.1.3__tar.gz → 0.1.5__tar.gz

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.
Files changed (72) hide show
  1. isaacus-0.1.5/.release-please-manifest.json +3 -0
  2. {isaacus-0.1.3 → isaacus-0.1.5}/CHANGELOG.md +29 -0
  3. {isaacus-0.1.3 → isaacus-0.1.5}/PKG-INFO +9 -7
  4. {isaacus-0.1.3 → isaacus-0.1.5}/README.md +6 -3
  5. isaacus-0.1.5/bin/publish-pypi +6 -0
  6. {isaacus-0.1.3 → isaacus-0.1.5}/pyproject.toml +2 -2
  7. {isaacus-0.1.3 → isaacus-0.1.5}/src/isaacus/_models.py +5 -2
  8. {isaacus-0.1.3 → isaacus-0.1.5}/src/isaacus/_version.py +1 -1
  9. {isaacus-0.1.3 → isaacus-0.1.5}/src/isaacus/resources/classifications/universal.py +12 -10
  10. {isaacus-0.1.3 → isaacus-0.1.5}/src/isaacus/types/classifications/universal_create_params.py +8 -5
  11. {isaacus-0.1.3 → isaacus-0.1.5}/tests/test_models.py +32 -0
  12. isaacus-0.1.3/.release-please-manifest.json +0 -3
  13. isaacus-0.1.3/bin/publish-pypi +0 -9
  14. {isaacus-0.1.3 → isaacus-0.1.5}/.gitignore +0 -0
  15. {isaacus-0.1.3 → isaacus-0.1.5}/CONTRIBUTING.md +0 -0
  16. {isaacus-0.1.3 → isaacus-0.1.5}/LICENSE +0 -0
  17. {isaacus-0.1.3 → isaacus-0.1.5}/SECURITY.md +0 -0
  18. {isaacus-0.1.3 → isaacus-0.1.5}/api.md +0 -0
  19. {isaacus-0.1.3 → isaacus-0.1.5}/bin/check-release-environment +0 -0
  20. {isaacus-0.1.3 → isaacus-0.1.5}/examples/.keep +0 -0
  21. {isaacus-0.1.3 → isaacus-0.1.5}/mypy.ini +0 -0
  22. {isaacus-0.1.3 → isaacus-0.1.5}/noxfile.py +0 -0
  23. {isaacus-0.1.3 → isaacus-0.1.5}/release-please-config.json +0 -0
  24. {isaacus-0.1.3 → isaacus-0.1.5}/requirements-dev.lock +0 -0
  25. {isaacus-0.1.3 → isaacus-0.1.5}/requirements.lock +0 -0
  26. {isaacus-0.1.3 → isaacus-0.1.5}/src/isaacus/__init__.py +0 -0
  27. {isaacus-0.1.3 → isaacus-0.1.5}/src/isaacus/_base_client.py +0 -0
  28. {isaacus-0.1.3 → isaacus-0.1.5}/src/isaacus/_client.py +0 -0
  29. {isaacus-0.1.3 → isaacus-0.1.5}/src/isaacus/_compat.py +0 -0
  30. {isaacus-0.1.3 → isaacus-0.1.5}/src/isaacus/_constants.py +0 -0
  31. {isaacus-0.1.3 → isaacus-0.1.5}/src/isaacus/_exceptions.py +0 -0
  32. {isaacus-0.1.3 → isaacus-0.1.5}/src/isaacus/_files.py +0 -0
  33. {isaacus-0.1.3 → isaacus-0.1.5}/src/isaacus/_qs.py +0 -0
  34. {isaacus-0.1.3 → isaacus-0.1.5}/src/isaacus/_resource.py +0 -0
  35. {isaacus-0.1.3 → isaacus-0.1.5}/src/isaacus/_response.py +0 -0
  36. {isaacus-0.1.3 → isaacus-0.1.5}/src/isaacus/_streaming.py +0 -0
  37. {isaacus-0.1.3 → isaacus-0.1.5}/src/isaacus/_types.py +0 -0
  38. {isaacus-0.1.3 → isaacus-0.1.5}/src/isaacus/_utils/__init__.py +0 -0
  39. {isaacus-0.1.3 → isaacus-0.1.5}/src/isaacus/_utils/_logs.py +0 -0
  40. {isaacus-0.1.3 → isaacus-0.1.5}/src/isaacus/_utils/_proxy.py +0 -0
  41. {isaacus-0.1.3 → isaacus-0.1.5}/src/isaacus/_utils/_reflection.py +0 -0
  42. {isaacus-0.1.3 → isaacus-0.1.5}/src/isaacus/_utils/_streams.py +0 -0
  43. {isaacus-0.1.3 → isaacus-0.1.5}/src/isaacus/_utils/_sync.py +0 -0
  44. {isaacus-0.1.3 → isaacus-0.1.5}/src/isaacus/_utils/_transform.py +0 -0
  45. {isaacus-0.1.3 → isaacus-0.1.5}/src/isaacus/_utils/_typing.py +0 -0
  46. {isaacus-0.1.3 → isaacus-0.1.5}/src/isaacus/_utils/_utils.py +0 -0
  47. {isaacus-0.1.3 → isaacus-0.1.5}/src/isaacus/lib/.keep +0 -0
  48. {isaacus-0.1.3 → isaacus-0.1.5}/src/isaacus/py.typed +0 -0
  49. {isaacus-0.1.3 → isaacus-0.1.5}/src/isaacus/resources/__init__.py +0 -0
  50. {isaacus-0.1.3 → isaacus-0.1.5}/src/isaacus/resources/classifications/__init__.py +0 -0
  51. {isaacus-0.1.3 → isaacus-0.1.5}/src/isaacus/resources/classifications/classifications.py +0 -0
  52. {isaacus-0.1.3 → isaacus-0.1.5}/src/isaacus/types/__init__.py +0 -0
  53. {isaacus-0.1.3 → isaacus-0.1.5}/src/isaacus/types/classifications/__init__.py +0 -0
  54. {isaacus-0.1.3 → isaacus-0.1.5}/src/isaacus/types/classifications/universal_classification.py +0 -0
  55. {isaacus-0.1.3 → isaacus-0.1.5}/tests/__init__.py +0 -0
  56. {isaacus-0.1.3 → isaacus-0.1.5}/tests/api_resources/__init__.py +0 -0
  57. {isaacus-0.1.3 → isaacus-0.1.5}/tests/api_resources/classifications/__init__.py +0 -0
  58. {isaacus-0.1.3 → isaacus-0.1.5}/tests/api_resources/classifications/test_universal.py +0 -0
  59. {isaacus-0.1.3 → isaacus-0.1.5}/tests/conftest.py +0 -0
  60. {isaacus-0.1.3 → isaacus-0.1.5}/tests/sample_file.txt +0 -0
  61. {isaacus-0.1.3 → isaacus-0.1.5}/tests/test_client.py +0 -0
  62. {isaacus-0.1.3 → isaacus-0.1.5}/tests/test_deepcopy.py +0 -0
  63. {isaacus-0.1.3 → isaacus-0.1.5}/tests/test_extract_files.py +0 -0
  64. {isaacus-0.1.3 → isaacus-0.1.5}/tests/test_files.py +0 -0
  65. {isaacus-0.1.3 → isaacus-0.1.5}/tests/test_qs.py +0 -0
  66. {isaacus-0.1.3 → isaacus-0.1.5}/tests/test_required_args.py +0 -0
  67. {isaacus-0.1.3 → isaacus-0.1.5}/tests/test_response.py +0 -0
  68. {isaacus-0.1.3 → isaacus-0.1.5}/tests/test_streaming.py +0 -0
  69. {isaacus-0.1.3 → isaacus-0.1.5}/tests/test_transform.py +0 -0
  70. {isaacus-0.1.3 → isaacus-0.1.5}/tests/test_utils/test_proxy.py +0 -0
  71. {isaacus-0.1.3 → isaacus-0.1.5}/tests/test_utils/test_typing.py +0 -0
  72. {isaacus-0.1.3 → isaacus-0.1.5}/tests/utils.py +0 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.1.5"
3
+ }
@@ -1,5 +1,34 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.5 (2025-03-17)
4
+
5
+ Full Changelog: [v0.1.4...v0.1.5](https://github.com/isaacus-dev/isaacus-python/compare/v0.1.4...v0.1.5)
6
+
7
+ ### Bug Fixes
8
+
9
+ * **ci:** ensure pip is always available ([#36](https://github.com/isaacus-dev/isaacus-python/issues/36)) ([36a0c57](https://github.com/isaacus-dev/isaacus-python/commit/36a0c57afe1ebeab214bd06072ece3710472a591))
10
+ * **ci:** remove publishing patch ([#38](https://github.com/isaacus-dev/isaacus-python/issues/38)) ([ff4ced3](https://github.com/isaacus-dev/isaacus-python/commit/ff4ced35d19f34c531b25eef905133f4489e265c))
11
+
12
+ ## 0.1.4 (2025-03-15)
13
+
14
+ Full Changelog: [v0.1.3...v0.1.4](https://github.com/isaacus-dev/isaacus-python/compare/v0.1.3...v0.1.4)
15
+
16
+ ### Features
17
+
18
+ * **api:** added latest OpenAPI specification ([#29](https://github.com/isaacus-dev/isaacus-python/issues/29)) ([411d83f](https://github.com/isaacus-dev/isaacus-python/commit/411d83f2da5913573e8e09c281a5dfb949670bf9))
19
+ * **api:** added latest OpenAPI specification ([#33](https://github.com/isaacus-dev/isaacus-python/issues/33)) ([b053a4a](https://github.com/isaacus-dev/isaacus-python/commit/b053a4a60f48d9d3197d384fe6e3a57723216ac9))
20
+ * **api:** added latest OpenAPI specification ([#34](https://github.com/isaacus-dev/isaacus-python/issues/34)) ([d9aef7f](https://github.com/isaacus-dev/isaacus-python/commit/d9aef7fa1d6f5283bdd3afd1962f52d2ed072499))
21
+
22
+
23
+ ### Bug Fixes
24
+
25
+ * **types:** handle more discriminated union shapes ([#32](https://github.com/isaacus-dev/isaacus-python/issues/32)) ([0644ad3](https://github.com/isaacus-dev/isaacus-python/commit/0644ad39f602b43ee03e4eb4ec58b05cb5ff28aa))
26
+
27
+
28
+ ### Chores
29
+
30
+ * **internal:** bump rye to 0.44.0 ([#31](https://github.com/isaacus-dev/isaacus-python/issues/31)) ([371c249](https://github.com/isaacus-dev/isaacus-python/commit/371c2490695cd773b8202c8cd016360535609923))
31
+
3
32
  ## 0.1.3 (2025-03-15)
4
33
 
5
34
  Full Changelog: [v0.1.2...v0.1.3](https://github.com/isaacus-dev/isaacus-python/compare/v0.1.2...v0.1.3)
@@ -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.5
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
@@ -47,10 +46,13 @@ The REST API documentation can be found on [docs.isaacus.com](https://docs.isaac
47
46
  ## Installation
48
47
 
49
48
  ```sh
50
- # install from PyPI
51
- pip install isaacus
49
+ # install from the production repo
50
+ pip install git+ssh://git@github.com/isaacus-dev/isaacus-python.git
52
51
  ```
53
52
 
53
+ > [!NOTE]
54
+ > Once this package is [published to PyPI](https://app.stainless.com/docs/guides/publish), this will become: `pip install isaacus`
55
+
54
56
  ## Usage
55
57
 
56
58
  The full API of this library can be found in [api.md](https://github.com/isaacus-dev/isaacus-python/tree/main/api.md).
@@ -128,7 +130,7 @@ universal_classification = client.classifications.universal.create(
128
130
  text="I agree not to tell anyone about the document.",
129
131
  chunking_options={
130
132
  "overlap_ratio": 0.1,
131
- "overlap_tokens": 0,
133
+ "overlap_tokens": None,
132
134
  "size": 512,
133
135
  },
134
136
  )
@@ -15,10 +15,13 @@ The REST API documentation can be found on [docs.isaacus.com](https://docs.isaac
15
15
  ## Installation
16
16
 
17
17
  ```sh
18
- # install from PyPI
19
- pip install isaacus
18
+ # install from the production repo
19
+ pip install git+ssh://git@github.com/isaacus-dev/isaacus-python.git
20
20
  ```
21
21
 
22
+ > [!NOTE]
23
+ > Once this package is [published to PyPI](https://app.stainless.com/docs/guides/publish), this will become: `pip install isaacus`
24
+
22
25
  ## Usage
23
26
 
24
27
  The full API of this library can be found in [api.md](api.md).
@@ -96,7 +99,7 @@ universal_classification = client.classifications.universal.create(
96
99
  text="I agree not to tell anyone about the document.",
97
100
  chunking_options={
98
101
  "overlap_ratio": 0.1,
99
- "overlap_tokens": 0,
102
+ "overlap_tokens": None,
100
103
  "size": 512,
101
104
  },
102
105
  )
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env bash
2
+
3
+ set -eux
4
+ mkdir -p dist
5
+ rye build --clean
6
+ rye publish --yes --token=$PYPI_TOKEN
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "isaacus"
3
- version = "0.1.3"
3
+ version = "0.1.5"
4
4
  description = "The official Python library for the isaacus API"
5
5
  dynamic = ["readme"]
6
6
  license = "Apache-2.0"
@@ -86,7 +86,7 @@ typecheck = { chain = [
86
86
  "typecheck:mypy" = "mypy ."
87
87
 
88
88
  [build-system]
89
- requires = ["hatchling", "hatch-fancy-pypi-readme"]
89
+ requires = ["hatchling==1.26.3", "hatch-fancy-pypi-readme"]
90
90
  build-backend = "hatchling.build"
91
91
 
92
92
  [tool.hatch.build]
@@ -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
@@ -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.5" # 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"]
@@ -854,3 +854,35 @@ def test_field_named_cls() -> None:
854
854
  m = construct_type(value={"cls": "foo"}, type_=Model)
855
855
  assert isinstance(m, Model)
856
856
  assert isinstance(m.cls, str)
857
+
858
+
859
+ def test_discriminated_union_case() -> None:
860
+ class A(BaseModel):
861
+ type: Literal["a"]
862
+
863
+ data: bool
864
+
865
+ class B(BaseModel):
866
+ type: Literal["b"]
867
+
868
+ data: List[Union[A, object]]
869
+
870
+ class ModelA(BaseModel):
871
+ type: Literal["modelA"]
872
+
873
+ data: int
874
+
875
+ class ModelB(BaseModel):
876
+ type: Literal["modelB"]
877
+
878
+ required: str
879
+
880
+ data: Union[A, B]
881
+
882
+ # when constructing ModelA | ModelB, value data doesn't match ModelB exactly - missing `required`
883
+ m = construct_type(
884
+ value={"type": "modelB", "data": {"type": "a", "data": True}},
885
+ type_=cast(Any, Annotated[Union[ModelA, ModelB], PropertyInfo(discriminator="type")]),
886
+ )
887
+
888
+ assert isinstance(m, ModelB)
@@ -1,3 +0,0 @@
1
- {
2
- ".": "0.1.3"
3
- }
@@ -1,9 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- set -eux
4
- mkdir -p dist
5
- rye build --clean
6
- # Patching importlib-metadata version until upstream library version is updated
7
- # https://github.com/pypa/twine/issues/977#issuecomment-2189800841
8
- "$HOME/.rye/self/bin/python3" -m pip install 'importlib-metadata==7.2.1'
9
- rye publish --yes --token=$PYPI_TOKEN
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes