isaacus 0.7.0__tar.gz → 0.9.0__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 (92) hide show
  1. {isaacus-0.7.0 → isaacus-0.9.0}/.gitignore +0 -1
  2. isaacus-0.9.0/.release-please-manifest.json +3 -0
  3. {isaacus-0.7.0 → isaacus-0.9.0}/CHANGELOG.md +98 -0
  4. {isaacus-0.7.0 → isaacus-0.9.0}/PKG-INFO +90 -37
  5. {isaacus-0.7.0 → isaacus-0.9.0}/README.md +85 -36
  6. {isaacus-0.7.0 → isaacus-0.9.0}/api.md +18 -6
  7. {isaacus-0.7.0 → isaacus-0.9.0}/bin/check-release-environment +1 -1
  8. {isaacus-0.7.0 → isaacus-0.9.0}/pyproject.toml +64 -4
  9. {isaacus-0.7.0 → isaacus-0.9.0}/requirements-dev.lock +38 -5
  10. {isaacus-0.7.0 → isaacus-0.9.0}/requirements.lock +34 -4
  11. {isaacus-0.7.0 → isaacus-0.9.0}/src/isaacus/__init__.py +5 -2
  12. {isaacus-0.7.0 → isaacus-0.9.0}/src/isaacus/_base_client.py +86 -15
  13. {isaacus-0.7.0 → isaacus-0.9.0}/src/isaacus/_client.py +17 -9
  14. {isaacus-0.7.0 → isaacus-0.9.0}/src/isaacus/_compat.py +48 -48
  15. {isaacus-0.7.0 → isaacus-0.9.0}/src/isaacus/_files.py +4 -4
  16. {isaacus-0.7.0 → isaacus-0.9.0}/src/isaacus/_models.py +80 -50
  17. {isaacus-0.7.0 → isaacus-0.9.0}/src/isaacus/_qs.py +7 -7
  18. {isaacus-0.7.0 → isaacus-0.9.0}/src/isaacus/_types.py +53 -12
  19. {isaacus-0.7.0 → isaacus-0.9.0}/src/isaacus/_utils/__init__.py +9 -2
  20. isaacus-0.9.0/src/isaacus/_utils/_compat.py +45 -0
  21. isaacus-0.9.0/src/isaacus/_utils/_datetime_parse.py +136 -0
  22. {isaacus-0.7.0 → isaacus-0.9.0}/src/isaacus/_utils/_transform.py +13 -3
  23. {isaacus-0.7.0 → isaacus-0.9.0}/src/isaacus/_utils/_typing.py +6 -1
  24. {isaacus-0.7.0 → isaacus-0.9.0}/src/isaacus/_utils/_utils.py +4 -5
  25. {isaacus-0.7.0 → isaacus-0.9.0}/src/isaacus/_version.py +1 -1
  26. {isaacus-0.7.0 → isaacus-0.9.0}/src/isaacus/resources/__init__.py +14 -0
  27. {isaacus-0.7.0 → isaacus-0.9.0}/src/isaacus/resources/classifications/universal.py +17 -17
  28. isaacus-0.9.0/src/isaacus/resources/embeddings.py +246 -0
  29. {isaacus-0.7.0 → isaacus-0.9.0}/src/isaacus/resources/extractions/qa.py +23 -21
  30. {isaacus-0.7.0 → isaacus-0.9.0}/src/isaacus/resources/rerankings.py +19 -19
  31. isaacus-0.9.0/src/isaacus/types/__init__.py +8 -0
  32. {isaacus-0.7.0 → isaacus-0.9.0}/src/isaacus/types/classifications/__init__.py +1 -1
  33. isaacus-0.7.0/src/isaacus/types/classifications/universal_classification.py → isaacus-0.9.0/src/isaacus/types/classifications/universal_classification_response.py +2 -2
  34. {isaacus-0.7.0 → isaacus-0.9.0}/src/isaacus/types/classifications/universal_create_params.py +4 -2
  35. isaacus-0.9.0/src/isaacus/types/embedding_create_params.py +49 -0
  36. isaacus-0.9.0/src/isaacus/types/embedding_response.py +31 -0
  37. {isaacus-0.7.0 → isaacus-0.9.0}/src/isaacus/types/extractions/__init__.py +1 -1
  38. isaacus-0.7.0/src/isaacus/types/extractions/answer_extraction.py → isaacus-0.9.0/src/isaacus/types/extractions/answer_extraction_response.py +2 -2
  39. {isaacus-0.7.0 → isaacus-0.9.0}/src/isaacus/types/extractions/qa_create_params.py +7 -4
  40. {isaacus-0.7.0 → isaacus-0.9.0}/src/isaacus/types/reranking_create_params.py +4 -2
  41. isaacus-0.7.0/src/isaacus/types/reranking.py → isaacus-0.9.0/src/isaacus/types/reranking_response.py +2 -2
  42. {isaacus-0.7.0 → isaacus-0.9.0}/tests/api_resources/classifications/test_universal.py +22 -20
  43. {isaacus-0.7.0 → isaacus-0.9.0}/tests/api_resources/extractions/test_qa.py +22 -20
  44. isaacus-0.9.0/tests/api_resources/test_embeddings.py +122 -0
  45. {isaacus-0.7.0 → isaacus-0.9.0}/tests/api_resources/test_rerankings.py +22 -20
  46. {isaacus-0.7.0 → isaacus-0.9.0}/tests/conftest.py +39 -6
  47. {isaacus-0.7.0 → isaacus-0.9.0}/tests/test_client.py +106 -156
  48. {isaacus-0.7.0 → isaacus-0.9.0}/tests/test_models.py +96 -24
  49. {isaacus-0.7.0 → isaacus-0.9.0}/tests/test_transform.py +17 -10
  50. isaacus-0.9.0/tests/test_utils/test_datetime_parse.py +110 -0
  51. {isaacus-0.7.0 → isaacus-0.9.0}/tests/utils.py +13 -5
  52. isaacus-0.7.0/.release-please-manifest.json +0 -3
  53. isaacus-0.7.0/mypy.ini +0 -50
  54. isaacus-0.7.0/src/isaacus/types/__init__.py +0 -6
  55. {isaacus-0.7.0 → isaacus-0.9.0}/CONTRIBUTING.md +0 -0
  56. {isaacus-0.7.0 → isaacus-0.9.0}/LICENSE +0 -0
  57. {isaacus-0.7.0 → isaacus-0.9.0}/SECURITY.md +0 -0
  58. {isaacus-0.7.0 → isaacus-0.9.0}/bin/publish-pypi +0 -0
  59. {isaacus-0.7.0 → isaacus-0.9.0}/examples/.keep +0 -0
  60. {isaacus-0.7.0 → isaacus-0.9.0}/noxfile.py +0 -0
  61. {isaacus-0.7.0 → isaacus-0.9.0}/release-please-config.json +0 -0
  62. {isaacus-0.7.0 → isaacus-0.9.0}/src/isaacus/_constants.py +0 -0
  63. {isaacus-0.7.0 → isaacus-0.9.0}/src/isaacus/_exceptions.py +0 -0
  64. {isaacus-0.7.0 → isaacus-0.9.0}/src/isaacus/_resource.py +0 -0
  65. {isaacus-0.7.0 → isaacus-0.9.0}/src/isaacus/_response.py +0 -0
  66. {isaacus-0.7.0 → isaacus-0.9.0}/src/isaacus/_streaming.py +0 -0
  67. {isaacus-0.7.0 → isaacus-0.9.0}/src/isaacus/_utils/_logs.py +0 -0
  68. {isaacus-0.7.0 → isaacus-0.9.0}/src/isaacus/_utils/_proxy.py +0 -0
  69. {isaacus-0.7.0 → isaacus-0.9.0}/src/isaacus/_utils/_reflection.py +0 -0
  70. {isaacus-0.7.0 → isaacus-0.9.0}/src/isaacus/_utils/_resources_proxy.py +0 -0
  71. {isaacus-0.7.0 → isaacus-0.9.0}/src/isaacus/_utils/_streams.py +0 -0
  72. {isaacus-0.7.0 → isaacus-0.9.0}/src/isaacus/_utils/_sync.py +0 -0
  73. {isaacus-0.7.0 → isaacus-0.9.0}/src/isaacus/lib/.keep +0 -0
  74. {isaacus-0.7.0 → isaacus-0.9.0}/src/isaacus/py.typed +0 -0
  75. {isaacus-0.7.0 → isaacus-0.9.0}/src/isaacus/resources/classifications/__init__.py +0 -0
  76. {isaacus-0.7.0 → isaacus-0.9.0}/src/isaacus/resources/classifications/classifications.py +0 -0
  77. {isaacus-0.7.0 → isaacus-0.9.0}/src/isaacus/resources/extractions/__init__.py +0 -0
  78. {isaacus-0.7.0 → isaacus-0.9.0}/src/isaacus/resources/extractions/extractions.py +0 -0
  79. {isaacus-0.7.0 → isaacus-0.9.0}/tests/__init__.py +0 -0
  80. {isaacus-0.7.0 → isaacus-0.9.0}/tests/api_resources/__init__.py +0 -0
  81. {isaacus-0.7.0 → isaacus-0.9.0}/tests/api_resources/classifications/__init__.py +0 -0
  82. {isaacus-0.7.0 → isaacus-0.9.0}/tests/api_resources/extractions/__init__.py +0 -0
  83. {isaacus-0.7.0 → isaacus-0.9.0}/tests/sample_file.txt +0 -0
  84. {isaacus-0.7.0 → isaacus-0.9.0}/tests/test_deepcopy.py +0 -0
  85. {isaacus-0.7.0 → isaacus-0.9.0}/tests/test_extract_files.py +0 -0
  86. {isaacus-0.7.0 → isaacus-0.9.0}/tests/test_files.py +0 -0
  87. {isaacus-0.7.0 → isaacus-0.9.0}/tests/test_qs.py +0 -0
  88. {isaacus-0.7.0 → isaacus-0.9.0}/tests/test_required_args.py +0 -0
  89. {isaacus-0.7.0 → isaacus-0.9.0}/tests/test_response.py +0 -0
  90. {isaacus-0.7.0 → isaacus-0.9.0}/tests/test_streaming.py +0 -0
  91. {isaacus-0.7.0 → isaacus-0.9.0}/tests/test_utils/test_proxy.py +0 -0
  92. {isaacus-0.7.0 → isaacus-0.9.0}/tests/test_utils/test_typing.py +0 -0
@@ -1,5 +1,4 @@
1
1
  .prism.log
2
- .vscode
3
2
  _dev
4
3
 
5
4
  __pycache__
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.9.0"
3
+ }
@@ -1,5 +1,103 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.9.0 (2025-10-14)
4
+
5
+ Full Changelog: [v0.8.0...v0.9.0](https://github.com/isaacus-dev/isaacus-python/compare/v0.8.0...v0.9.0)
6
+
7
+ ### ⚠ BREAKING CHANGES
8
+
9
+ * **api:** reduce max length of embeddings input
10
+ * **sdk:** add `_response` to response models to finally fix duplicated names
11
+
12
+ ### Features
13
+
14
+ * **api:** added embedding endpoint ([88190d6](https://github.com/isaacus-dev/isaacus-python/commit/88190d6d33c8d5e3cf59dfd3c488b5ae9abec93b))
15
+ * **api:** reduce max length of embeddings input ([0ad7114](https://github.com/isaacus-dev/isaacus-python/commit/0ad7114b5fec2fde9aaa830a6ba6163ad3b6fccc))
16
+ * **api:** rename embedding -> embeddings ([204a05d](https://github.com/isaacus-dev/isaacus-python/commit/204a05d7b1504901766db3c0d0d8ea47a22a16ed))
17
+ * **api:** revert embedding -> embeddings ([b934279](https://github.com/isaacus-dev/isaacus-python/commit/b9342795e50374817b8e3dc2e2f1163a2ff0805a))
18
+ * **client:** support file upload requests ([2ab398d](https://github.com/isaacus-dev/isaacus-python/commit/2ab398dde07e98411c9b6efd76f7b7120a9633a8))
19
+ * improve future compat with pydantic v3 ([5a20497](https://github.com/isaacus-dev/isaacus-python/commit/5a20497a9c4bbf88056df12a0c686566dc9bd162))
20
+ * **sdk:** add embeddings endpoint ([920ae0b](https://github.com/isaacus-dev/isaacus-python/commit/920ae0b65f2362ac098f8b94979b1e821f5143d8))
21
+ * **sdk:** toggle to force regen ([cf60482](https://github.com/isaacus-dev/isaacus-python/commit/cf60482ba0dd3933daee477fa9bd4ae29d900fb4))
22
+ * **sdk:** untoggle to force regen ([25d2067](https://github.com/isaacus-dev/isaacus-python/commit/25d2067fad4bb46ca595001f6e82458fd3d24a23))
23
+ * **types:** replace List[str] with SequenceNotStr in params ([d2733a9](https://github.com/isaacus-dev/isaacus-python/commit/d2733a9d0f16531537a9db017a8e29d2c8fb3912))
24
+
25
+
26
+ ### Bug Fixes
27
+
28
+ * **api:** typo ([5d4a1b9](https://github.com/isaacus-dev/isaacus-python/commit/5d4a1b99e8a6ac2a1c3cc4e83e7b65108eea335a))
29
+ * avoid newer type syntax ([10253fe](https://github.com/isaacus-dev/isaacus-python/commit/10253fe93ed8142b52cf5199486221e81ac6ce5a))
30
+ * **sdk:** add `_response` to response models to finally fix duplicated names ([5c7462d](https://github.com/isaacus-dev/isaacus-python/commit/5c7462dd25c67c44126eb946a656a6b841dc6a50))
31
+
32
+
33
+ ### Chores
34
+
35
+ * **api:** try to force regen SDK ([2fafb55](https://github.com/isaacus-dev/isaacus-python/commit/2fafb555c1a20d7c359c91c35fd1f54868cffe54))
36
+ * do not install brew dependencies in ./scripts/bootstrap by default ([57b055e](https://github.com/isaacus-dev/isaacus-python/commit/57b055ed56fdcc58b4663e4ddad32afac25e7ec1))
37
+ * improve example values ([35b03bd](https://github.com/isaacus-dev/isaacus-python/commit/35b03bdbf4ceaccd00102e23d639a01d5bea136a))
38
+ * **internal:** add Sequence related utils ([5a2287e](https://github.com/isaacus-dev/isaacus-python/commit/5a2287ef854d250048c070f3fd88b00ca84b0d3c))
39
+ * **internal:** change ci workflow machines ([f86cbce](https://github.com/isaacus-dev/isaacus-python/commit/f86cbcef2583658466e95eaba4aba61f79646ef9))
40
+ * **internal:** codegen related update ([22b520b](https://github.com/isaacus-dev/isaacus-python/commit/22b520b3c67e570f9267135111a89542ee2bdf7f))
41
+ * **internal:** fix ruff target version ([889d576](https://github.com/isaacus-dev/isaacus-python/commit/889d576cdc28d06404c6ee3ce0c67bf4d3be75c4))
42
+ * **internal:** move mypy configurations to `pyproject.toml` file ([d5732d5](https://github.com/isaacus-dev/isaacus-python/commit/d5732d5e0145763723e8be24cbd8296f9a385264))
43
+ * **internal:** update comment in script ([7af966e](https://github.com/isaacus-dev/isaacus-python/commit/7af966e1677b44d412eda96c5ee8e9866f77ccfb))
44
+ * **internal:** update pydantic dependency ([68a7057](https://github.com/isaacus-dev/isaacus-python/commit/68a70578a2e269fa3b2c46e3c29e82ba770090d6))
45
+ * **internal:** update pyright exclude list ([6f0ae86](https://github.com/isaacus-dev/isaacus-python/commit/6f0ae86899883fe77aa669d595c623bedc2dc5c8))
46
+ * remove custom code ([491dbdc](https://github.com/isaacus-dev/isaacus-python/commit/491dbdcd82984d099b8ee11e94894ad450b2424d))
47
+ * **sdk:** restore original example ([079645e](https://github.com/isaacus-dev/isaacus-python/commit/079645e85259c2e4d3f6aa86b2ca2c21ce97367a))
48
+ * **tests:** simplify `get_platform` test ([e00ccd0](https://github.com/isaacus-dev/isaacus-python/commit/e00ccd0c41c3751eb3fae880223ebb05eae0f154))
49
+ * **types:** change optional parameter type from NotGiven to Omit ([38d13e0](https://github.com/isaacus-dev/isaacus-python/commit/38d13e0514b001d1a34446b881783d559e246865))
50
+ * update @stainless-api/prism-cli to v5.15.0 ([a3141f5](https://github.com/isaacus-dev/isaacus-python/commit/a3141f59b0ff6334fde2a9740fd2f86824fe5083))
51
+ * update github action ([0518028](https://github.com/isaacus-dev/isaacus-python/commit/05180288265bc111dba1c62fbfcd90139a6299ad))
52
+
53
+
54
+ ### Documentation
55
+
56
+ * **sdk:** make embeddings example first ([caa70f7](https://github.com/isaacus-dev/isaacus-python/commit/caa70f7acf6ce910d8cf80425437ca51970cd255))
57
+
58
+ ## 0.8.0 (2025-07-25)
59
+
60
+ Full Changelog: [v0.7.0...v0.8.0](https://github.com/isaacus-dev/isaacus-python/compare/v0.7.0...v0.8.0)
61
+
62
+ ### Features
63
+
64
+ * clean up environment call outs ([3ee6948](https://github.com/isaacus-dev/isaacus-python/commit/3ee69481b6a6198503d06c6aa137ba69f7940db6))
65
+ * **client:** add support for aiohttp ([fba17e9](https://github.com/isaacus-dev/isaacus-python/commit/fba17e98279aa6d93dd3c9b6f9b95246b4fac813))
66
+
67
+
68
+ ### Bug Fixes
69
+
70
+ * **ci:** correct conditional ([53c81d9](https://github.com/isaacus-dev/isaacus-python/commit/53c81d9e14882ae83a72c15481c8933226e668fa))
71
+ * **ci:** release-doctor — report correct token name ([3cb8672](https://github.com/isaacus-dev/isaacus-python/commit/3cb8672052edf1d1c4e72a5866fde3776d43a4e2))
72
+ * **client:** correctly parse binary response | stream ([5e316fe](https://github.com/isaacus-dev/isaacus-python/commit/5e316feaf5270e54321a917a9cd59efb2c42fcb3))
73
+ * **client:** don't send Content-Type header on GET requests ([2a5d531](https://github.com/isaacus-dev/isaacus-python/commit/2a5d531e7553aa012352d9dd85d280f4374b7ae7))
74
+ * **parsing:** correctly handle nested discriminated unions ([c5d5715](https://github.com/isaacus-dev/isaacus-python/commit/c5d571569cdafad9bd1392baf232287dca72855d))
75
+ * **parsing:** ignore empty metadata ([dd88d17](https://github.com/isaacus-dev/isaacus-python/commit/dd88d179302966445c63831f4b6f20491fe5632e))
76
+ * **parsing:** parse extra field types ([ba334c7](https://github.com/isaacus-dev/isaacus-python/commit/ba334c75676c37da235abfddd7c9746f89307c22))
77
+ * **tests:** fix: tests which call HTTP endpoints directly with the example parameters ([638c7c4](https://github.com/isaacus-dev/isaacus-python/commit/638c7c4df7ecbc189480a0cba2d93125f9b97d2f))
78
+
79
+
80
+ ### Chores
81
+
82
+ * **ci:** change upload type ([e79525c](https://github.com/isaacus-dev/isaacus-python/commit/e79525c4ffe9601c3b7c5e39a94c93c248cfbf33))
83
+ * **ci:** enable for pull requests ([29244fd](https://github.com/isaacus-dev/isaacus-python/commit/29244fdb33a5706480e1c7314099a14ae177ee06))
84
+ * **ci:** only run for pushes and fork pull requests ([94ed1eb](https://github.com/isaacus-dev/isaacus-python/commit/94ed1ebf9fc4111236f1db2a5d326f081079bdc8))
85
+ * **internal:** bump pinned h11 dep ([5836163](https://github.com/isaacus-dev/isaacus-python/commit/58361635226de79f5ff27e953ec03dfeb392b3e0))
86
+ * **internal:** codegen related update ([cdfe0be](https://github.com/isaacus-dev/isaacus-python/commit/cdfe0beceeeaa21e4a24b6cdc86264dcaa3808f1))
87
+ * **internal:** update conftest.py ([e4a5936](https://github.com/isaacus-dev/isaacus-python/commit/e4a59368bd7d42d65fd368b03a208b2aa32a9144))
88
+ * **package:** mark python 3.13 as supported ([0f7b5d1](https://github.com/isaacus-dev/isaacus-python/commit/0f7b5d1c588adf28b502727948dceaa9ed54ee86))
89
+ * **project:** add settings file for vscode ([d6435b0](https://github.com/isaacus-dev/isaacus-python/commit/d6435b09a03f202867843ee83737b319ccef4ea6))
90
+ * **readme:** fix version rendering on pypi ([b09f1ad](https://github.com/isaacus-dev/isaacus-python/commit/b09f1ad5ce2624d23a32fc1d966f7d9703cd4ad3))
91
+ * **readme:** update badges ([cd48569](https://github.com/isaacus-dev/isaacus-python/commit/cd485693063d03f092d5be7f024b0f7e23da0897))
92
+ * **tests:** add tests for httpx client instantiation & proxies ([5d2c5b9](https://github.com/isaacus-dev/isaacus-python/commit/5d2c5b9e20bd80acd05240217b6be3991b46aae2))
93
+ * **tests:** run tests in parallel ([3f0e6da](https://github.com/isaacus-dev/isaacus-python/commit/3f0e6da6d9c6d9cd46cfa382da55a0b6a07d9d49))
94
+ * **tests:** skip some failing tests on the latest python versions ([b2b3fa8](https://github.com/isaacus-dev/isaacus-python/commit/b2b3fa82b87e9cc7e23164cc5589b3e157e635df))
95
+
96
+
97
+ ### Documentation
98
+
99
+ * **client:** fix httpx.Timeout documentation reference ([b68d394](https://github.com/isaacus-dev/isaacus-python/commit/b68d3944df0ca58b7df3e89e06e90799f7ade25b))
100
+
3
101
  ## 0.7.0 (2025-06-03)
4
102
 
5
103
  Full Changelog: [v0.6.1...v0.7.0](https://github.com/isaacus-dev/isaacus-python/compare/v0.6.1...v0.7.0)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: isaacus
3
- Version: 0.7.0
3
+ Version: 0.9.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
@@ -18,6 +18,7 @@ Classifier: Programming Language :: Python :: 3.9
18
18
  Classifier: Programming Language :: Python :: 3.10
19
19
  Classifier: Programming Language :: Python :: 3.11
20
20
  Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
21
22
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
23
  Classifier: Typing :: Typed
23
24
  Requires-Python: >=3.8
@@ -27,11 +28,15 @@ Requires-Dist: httpx<1,>=0.23.0
27
28
  Requires-Dist: pydantic<3,>=1.9.0
28
29
  Requires-Dist: sniffio
29
30
  Requires-Dist: typing-extensions<5,>=4.10
31
+ Provides-Extra: aiohttp
32
+ Requires-Dist: aiohttp; extra == 'aiohttp'
33
+ Requires-Dist: httpx-aiohttp>=0.1.8; extra == 'aiohttp'
30
34
  Description-Content-Type: text/markdown
31
35
 
32
36
  # Isaacus Python API library
33
37
 
34
- [![PyPI version](https://img.shields.io/pypi/v/isaacus.svg)](https://pypi.org/project/isaacus/)
38
+ <!-- prettier-ignore -->
39
+ [![PyPI version](https://img.shields.io/pypi/v/isaacus.svg?label=pypi%20(stable))](https://pypi.org/project/isaacus/)
35
40
 
36
41
  The Isaacus Python library provides convenient access to the Isaacus REST API from any Python 3.8+
37
42
  application. The library includes type definitions for all request params and response fields,
@@ -62,12 +67,14 @@ client = Isaacus(
62
67
  api_key=os.environ.get("ISAACUS_API_KEY"), # This is the default and can be omitted
63
68
  )
64
69
 
65
- universal_classification = client.classifications.universal.create(
66
- model="kanon-universal-classifier",
67
- query="This is a confidentiality clause.",
68
- texts=["I agree not to tell anyone about the document."],
70
+ embedding_response = client.embeddings.create(
71
+ model="kanon-2-embedder",
72
+ texts=[
73
+ "Are restraints of trade enforceable under English law?",
74
+ "What is a non-compete clause?",
75
+ ],
69
76
  )
70
- print(universal_classification.classifications)
77
+ print(embedding_response.embeddings)
71
78
  ```
72
79
 
73
80
  While you can provide an `api_key` keyword argument,
@@ -90,12 +97,14 @@ client = AsyncIsaacus(
90
97
 
91
98
 
92
99
  async def main() -> None:
93
- universal_classification = await client.classifications.universal.create(
94
- model="kanon-universal-classifier",
95
- query="This is a confidentiality clause.",
96
- texts=["I agree not to tell anyone about the document."],
100
+ embedding_response = await client.embeddings.create(
101
+ model="kanon-2-embedder",
102
+ texts=[
103
+ "Are restraints of trade enforceable under English law?",
104
+ "What is a non-compete clause?",
105
+ ],
97
106
  )
98
- print(universal_classification.classifications)
107
+ print(embedding_response.embeddings)
99
108
 
100
109
 
101
110
  asyncio.run(main())
@@ -103,6 +112,43 @@ asyncio.run(main())
103
112
 
104
113
  Functionality between the synchronous and asynchronous clients is otherwise identical.
105
114
 
115
+ ### With aiohttp
116
+
117
+ By default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend.
118
+
119
+ You can enable this by installing `aiohttp`:
120
+
121
+ ```sh
122
+ # install from PyPI
123
+ pip install isaacus[aiohttp]
124
+ ```
125
+
126
+ Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
127
+
128
+ ```python
129
+ import asyncio
130
+ from isaacus import DefaultAioHttpClient
131
+ from isaacus import AsyncIsaacus
132
+
133
+
134
+ async def main() -> None:
135
+ async with AsyncIsaacus(
136
+ api_key="My API Key",
137
+ http_client=DefaultAioHttpClient(),
138
+ ) as client:
139
+ embedding_response = await client.embeddings.create(
140
+ model="kanon-2-embedder",
141
+ texts=[
142
+ "Are restraints of trade enforceable under English law?",
143
+ "What is a non-compete clause?",
144
+ ],
145
+ )
146
+ print(embedding_response.embeddings)
147
+
148
+
149
+ asyncio.run(main())
150
+ ```
151
+
106
152
  ## Using types
107
153
 
108
154
  Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:
@@ -121,7 +167,7 @@ from isaacus import Isaacus
121
167
 
122
168
  client = Isaacus()
123
169
 
124
- universal_classification = client.classifications.universal.create(
170
+ universal_classification_response = client.classifications.universal.create(
125
171
  model="kanon-universal-classifier",
126
172
  query="This is a confidentiality clause.",
127
173
  texts=["I agree not to tell anyone about the document."],
@@ -131,7 +177,7 @@ universal_classification = client.classifications.universal.create(
131
177
  "size": 512,
132
178
  },
133
179
  )
134
- print(universal_classification.classifications)
180
+ print(universal_classification_response.classifications)
135
181
  ```
136
182
 
137
183
  ## Handling errors
@@ -150,10 +196,12 @@ from isaacus import Isaacus
150
196
  client = Isaacus()
151
197
 
152
198
  try:
153
- client.classifications.universal.create(
154
- model="kanon-universal-classifier",
155
- query="This is a confidentiality clause.",
156
- texts=["I agree not to tell anyone about the document."],
199
+ client.embeddings.create(
200
+ model="kanon-2-embedder",
201
+ texts=[
202
+ "Are restraints of trade enforceable under English law?",
203
+ "What is a non-compete clause?",
204
+ ],
157
205
  )
158
206
  except isaacus.APIConnectionError as e:
159
207
  print("The server could not be reached")
@@ -197,17 +245,19 @@ client = Isaacus(
197
245
  )
198
246
 
199
247
  # Or, configure per-request:
200
- client.with_options(max_retries=5).classifications.universal.create(
201
- model="kanon-universal-classifier",
202
- query="This is a confidentiality clause.",
203
- texts=["I agree not to tell anyone about the document."],
248
+ client.with_options(max_retries=5).embeddings.create(
249
+ model="kanon-2-embedder",
250
+ texts=[
251
+ "Are restraints of trade enforceable under English law?",
252
+ "What is a non-compete clause?",
253
+ ],
204
254
  )
205
255
  ```
206
256
 
207
257
  ### Timeouts
208
258
 
209
259
  By default requests time out after 1 minute. You can configure this with a `timeout` option,
210
- which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object:
260
+ which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:
211
261
 
212
262
  ```python
213
263
  from isaacus import Isaacus
@@ -224,10 +274,12 @@ client = Isaacus(
224
274
  )
225
275
 
226
276
  # Override per-request:
227
- client.with_options(timeout=5.0).classifications.universal.create(
228
- model="kanon-universal-classifier",
229
- query="This is a confidentiality clause.",
230
- texts=["I agree not to tell anyone about the document."],
277
+ client.with_options(timeout=5.0).embeddings.create(
278
+ model="kanon-2-embedder",
279
+ texts=[
280
+ "Are restraints of trade enforceable under English law?",
281
+ "What is a non-compete clause?",
282
+ ],
231
283
  )
232
284
  ```
233
285
 
@@ -269,15 +321,14 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
269
321
  from isaacus import Isaacus
270
322
 
271
323
  client = Isaacus()
272
- response = client.classifications.universal.with_raw_response.create(
273
- model="kanon-universal-classifier",
274
- query="This is a confidentiality clause.",
275
- texts=["I agree not to tell anyone about the document."],
324
+ response = client.embeddings.with_raw_response.create(
325
+ model="kanon-2-embedder",
326
+ texts=["Are restraints of trade enforceable under English law?", "What is a non-compete clause?"],
276
327
  )
277
328
  print(response.headers.get('X-My-Header'))
278
329
 
279
- universal = response.parse() # get the object that `classifications.universal.create()` would have returned
280
- print(universal.classifications)
330
+ embedding = response.parse() # get the object that `embeddings.create()` would have returned
331
+ print(embedding.embeddings)
281
332
  ```
282
333
 
283
334
  These methods return an [`APIResponse`](https://github.com/isaacus-dev/isaacus-python/tree/main/src/isaacus/_response.py) object.
@@ -291,10 +342,12 @@ The above interface eagerly reads the full response body when you make the reque
291
342
  To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.
292
343
 
293
344
  ```python
294
- with client.classifications.universal.with_streaming_response.create(
295
- model="kanon-universal-classifier",
296
- query="This is a confidentiality clause.",
297
- texts=["I agree not to tell anyone about the document."],
345
+ with client.embeddings.with_streaming_response.create(
346
+ model="kanon-2-embedder",
347
+ texts=[
348
+ "Are restraints of trade enforceable under English law?",
349
+ "What is a non-compete clause?",
350
+ ],
298
351
  ) as response:
299
352
  print(response.headers.get("X-My-Header"))
300
353
 
@@ -1,6 +1,7 @@
1
1
  # Isaacus Python API library
2
2
 
3
- [![PyPI version](https://img.shields.io/pypi/v/isaacus.svg)](https://pypi.org/project/isaacus/)
3
+ <!-- prettier-ignore -->
4
+ [![PyPI version](https://img.shields.io/pypi/v/isaacus.svg?label=pypi%20(stable))](https://pypi.org/project/isaacus/)
4
5
 
5
6
  The Isaacus Python library provides convenient access to the Isaacus REST API from any Python 3.8+
6
7
  application. The library includes type definitions for all request params and response fields,
@@ -31,12 +32,14 @@ client = Isaacus(
31
32
  api_key=os.environ.get("ISAACUS_API_KEY"), # This is the default and can be omitted
32
33
  )
33
34
 
34
- universal_classification = client.classifications.universal.create(
35
- model="kanon-universal-classifier",
36
- query="This is a confidentiality clause.",
37
- texts=["I agree not to tell anyone about the document."],
35
+ embedding_response = client.embeddings.create(
36
+ model="kanon-2-embedder",
37
+ texts=[
38
+ "Are restraints of trade enforceable under English law?",
39
+ "What is a non-compete clause?",
40
+ ],
38
41
  )
39
- print(universal_classification.classifications)
42
+ print(embedding_response.embeddings)
40
43
  ```
41
44
 
42
45
  While you can provide an `api_key` keyword argument,
@@ -59,12 +62,14 @@ client = AsyncIsaacus(
59
62
 
60
63
 
61
64
  async def main() -> None:
62
- universal_classification = await client.classifications.universal.create(
63
- model="kanon-universal-classifier",
64
- query="This is a confidentiality clause.",
65
- texts=["I agree not to tell anyone about the document."],
65
+ embedding_response = await client.embeddings.create(
66
+ model="kanon-2-embedder",
67
+ texts=[
68
+ "Are restraints of trade enforceable under English law?",
69
+ "What is a non-compete clause?",
70
+ ],
66
71
  )
67
- print(universal_classification.classifications)
72
+ print(embedding_response.embeddings)
68
73
 
69
74
 
70
75
  asyncio.run(main())
@@ -72,6 +77,43 @@ asyncio.run(main())
72
77
 
73
78
  Functionality between the synchronous and asynchronous clients is otherwise identical.
74
79
 
80
+ ### With aiohttp
81
+
82
+ By default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend.
83
+
84
+ You can enable this by installing `aiohttp`:
85
+
86
+ ```sh
87
+ # install from PyPI
88
+ pip install isaacus[aiohttp]
89
+ ```
90
+
91
+ Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
92
+
93
+ ```python
94
+ import asyncio
95
+ from isaacus import DefaultAioHttpClient
96
+ from isaacus import AsyncIsaacus
97
+
98
+
99
+ async def main() -> None:
100
+ async with AsyncIsaacus(
101
+ api_key="My API Key",
102
+ http_client=DefaultAioHttpClient(),
103
+ ) as client:
104
+ embedding_response = await client.embeddings.create(
105
+ model="kanon-2-embedder",
106
+ texts=[
107
+ "Are restraints of trade enforceable under English law?",
108
+ "What is a non-compete clause?",
109
+ ],
110
+ )
111
+ print(embedding_response.embeddings)
112
+
113
+
114
+ asyncio.run(main())
115
+ ```
116
+
75
117
  ## Using types
76
118
 
77
119
  Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:
@@ -90,7 +132,7 @@ from isaacus import Isaacus
90
132
 
91
133
  client = Isaacus()
92
134
 
93
- universal_classification = client.classifications.universal.create(
135
+ universal_classification_response = client.classifications.universal.create(
94
136
  model="kanon-universal-classifier",
95
137
  query="This is a confidentiality clause.",
96
138
  texts=["I agree not to tell anyone about the document."],
@@ -100,7 +142,7 @@ universal_classification = client.classifications.universal.create(
100
142
  "size": 512,
101
143
  },
102
144
  )
103
- print(universal_classification.classifications)
145
+ print(universal_classification_response.classifications)
104
146
  ```
105
147
 
106
148
  ## Handling errors
@@ -119,10 +161,12 @@ from isaacus import Isaacus
119
161
  client = Isaacus()
120
162
 
121
163
  try:
122
- client.classifications.universal.create(
123
- model="kanon-universal-classifier",
124
- query="This is a confidentiality clause.",
125
- texts=["I agree not to tell anyone about the document."],
164
+ client.embeddings.create(
165
+ model="kanon-2-embedder",
166
+ texts=[
167
+ "Are restraints of trade enforceable under English law?",
168
+ "What is a non-compete clause?",
169
+ ],
126
170
  )
127
171
  except isaacus.APIConnectionError as e:
128
172
  print("The server could not be reached")
@@ -166,17 +210,19 @@ client = Isaacus(
166
210
  )
167
211
 
168
212
  # Or, configure per-request:
169
- client.with_options(max_retries=5).classifications.universal.create(
170
- model="kanon-universal-classifier",
171
- query="This is a confidentiality clause.",
172
- texts=["I agree not to tell anyone about the document."],
213
+ client.with_options(max_retries=5).embeddings.create(
214
+ model="kanon-2-embedder",
215
+ texts=[
216
+ "Are restraints of trade enforceable under English law?",
217
+ "What is a non-compete clause?",
218
+ ],
173
219
  )
174
220
  ```
175
221
 
176
222
  ### Timeouts
177
223
 
178
224
  By default requests time out after 1 minute. You can configure this with a `timeout` option,
179
- which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object:
225
+ which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:
180
226
 
181
227
  ```python
182
228
  from isaacus import Isaacus
@@ -193,10 +239,12 @@ client = Isaacus(
193
239
  )
194
240
 
195
241
  # Override per-request:
196
- client.with_options(timeout=5.0).classifications.universal.create(
197
- model="kanon-universal-classifier",
198
- query="This is a confidentiality clause.",
199
- texts=["I agree not to tell anyone about the document."],
242
+ client.with_options(timeout=5.0).embeddings.create(
243
+ model="kanon-2-embedder",
244
+ texts=[
245
+ "Are restraints of trade enforceable under English law?",
246
+ "What is a non-compete clause?",
247
+ ],
200
248
  )
201
249
  ```
202
250
 
@@ -238,15 +286,14 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
238
286
  from isaacus import Isaacus
239
287
 
240
288
  client = Isaacus()
241
- response = client.classifications.universal.with_raw_response.create(
242
- model="kanon-universal-classifier",
243
- query="This is a confidentiality clause.",
244
- texts=["I agree not to tell anyone about the document."],
289
+ response = client.embeddings.with_raw_response.create(
290
+ model="kanon-2-embedder",
291
+ texts=["Are restraints of trade enforceable under English law?", "What is a non-compete clause?"],
245
292
  )
246
293
  print(response.headers.get('X-My-Header'))
247
294
 
248
- universal = response.parse() # get the object that `classifications.universal.create()` would have returned
249
- print(universal.classifications)
295
+ embedding = response.parse() # get the object that `embeddings.create()` would have returned
296
+ print(embedding.embeddings)
250
297
  ```
251
298
 
252
299
  These methods return an [`APIResponse`](https://github.com/isaacus-dev/isaacus-python/tree/main/src/isaacus/_response.py) object.
@@ -260,10 +307,12 @@ The above interface eagerly reads the full response body when you make the reque
260
307
  To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.
261
308
 
262
309
  ```python
263
- with client.classifications.universal.with_streaming_response.create(
264
- model="kanon-universal-classifier",
265
- query="This is a confidentiality clause.",
266
- texts=["I agree not to tell anyone about the document."],
310
+ with client.embeddings.with_streaming_response.create(
311
+ model="kanon-2-embedder",
312
+ texts=[
313
+ "Are restraints of trade enforceable under English law?",
314
+ "What is a non-compete clause?",
315
+ ],
267
316
  ) as response:
268
317
  print(response.headers.get("X-My-Header"))
269
318
 
@@ -1,3 +1,15 @@
1
+ # Embeddings
2
+
3
+ Types:
4
+
5
+ ```python
6
+ from isaacus.types import EmbeddingResponse
7
+ ```
8
+
9
+ Methods:
10
+
11
+ - <code title="post /embeddings">client.embeddings.<a href="./src/isaacus/resources/embeddings.py">create</a>(\*\*<a href="src/isaacus/types/embedding_create_params.py">params</a>) -> <a href="./src/isaacus/types/embedding_response.py">EmbeddingResponse</a></code>
12
+
1
13
  # Classifications
2
14
 
3
15
  ## Universal
@@ -5,24 +17,24 @@
5
17
  Types:
6
18
 
7
19
  ```python
8
- from isaacus.types.classifications import UniversalClassification
20
+ from isaacus.types.classifications import UniversalClassificationResponse
9
21
  ```
10
22
 
11
23
  Methods:
12
24
 
13
- - <code title="post /classifications/universal">client.classifications.universal.<a href="./src/isaacus/resources/classifications/universal.py">create</a>(\*\*<a href="src/isaacus/types/classifications/universal_create_params.py">params</a>) -> <a href="./src/isaacus/types/classifications/universal_classification.py">UniversalClassification</a></code>
25
+ - <code title="post /classifications/universal">client.classifications.universal.<a href="./src/isaacus/resources/classifications/universal.py">create</a>(\*\*<a href="src/isaacus/types/classifications/universal_create_params.py">params</a>) -> <a href="./src/isaacus/types/classifications/universal_classification_response.py">UniversalClassificationResponse</a></code>
14
26
 
15
27
  # Rerankings
16
28
 
17
29
  Types:
18
30
 
19
31
  ```python
20
- from isaacus.types import Reranking
32
+ from isaacus.types import RerankingResponse
21
33
  ```
22
34
 
23
35
  Methods:
24
36
 
25
- - <code title="post /rerankings">client.rerankings.<a href="./src/isaacus/resources/rerankings.py">create</a>(\*\*<a href="src/isaacus/types/reranking_create_params.py">params</a>) -> <a href="./src/isaacus/types/reranking.py">Reranking</a></code>
37
+ - <code title="post /rerankings">client.rerankings.<a href="./src/isaacus/resources/rerankings.py">create</a>(\*\*<a href="src/isaacus/types/reranking_create_params.py">params</a>) -> <a href="./src/isaacus/types/reranking_response.py">RerankingResponse</a></code>
26
38
 
27
39
  # Extractions
28
40
 
@@ -31,9 +43,9 @@ Methods:
31
43
  Types:
32
44
 
33
45
  ```python
34
- from isaacus.types.extractions import AnswerExtraction
46
+ from isaacus.types.extractions import AnswerExtractionResponse
35
47
  ```
36
48
 
37
49
  Methods:
38
50
 
39
- - <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.py">AnswerExtraction</a></code>
51
+ - <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>
@@ -3,7 +3,7 @@
3
3
  errors=()
4
4
 
5
5
  if [ -z "${PYPI_TOKEN}" ]; then
6
- errors+=("The ISAACUS_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.")
6
+ errors+=("The PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.")
7
7
  fi
8
8
 
9
9
  lenErrors=${#errors[@]}