isaacus 0.1.0a1__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.
@@ -0,0 +1,391 @@
1
+ Metadata-Version: 2.4
2
+ Name: isaacus
3
+ Version: 0.1.0a1
4
+ Summary: The official Python library for the isaacus API
5
+ Project-URL: Homepage, https://github.com/isaacus-dev/isaacus-python
6
+ Project-URL: Repository, https://github.com/isaacus-dev/isaacus-python
7
+ Author-email: Isaacus <support@isaacus.com>
8
+ License-Expression: Apache-2.0
9
+ License-File: LICENSE
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: License :: OSI Approved :: Apache Software License
12
+ Classifier: Operating System :: MacOS
13
+ Classifier: Operating System :: Microsoft :: Windows
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Operating System :: POSIX
16
+ Classifier: Operating System :: POSIX :: Linux
17
+ Classifier: Programming Language :: Python :: 3.8
18
+ Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
23
+ Classifier: Typing :: Typed
24
+ Requires-Python: >=3.8
25
+ Requires-Dist: anyio<5,>=3.5.0
26
+ Requires-Dist: distro<2,>=1.7.0
27
+ Requires-Dist: httpx<1,>=0.23.0
28
+ Requires-Dist: pydantic<3,>=1.9.0
29
+ Requires-Dist: sniffio
30
+ Requires-Dist: typing-extensions<5,>=4.10
31
+ Description-Content-Type: text/markdown
32
+
33
+ # Isaacus Python API library
34
+
35
+ [![PyPI version](https://img.shields.io/pypi/v/isaacus.svg)](https://pypi.org/project/isaacus/)
36
+
37
+ The Isaacus Python library provides convenient access to the Isaacus REST API from any Python 3.8+
38
+ application. The library includes type definitions for all request params and response fields,
39
+ and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).
40
+
41
+ It is generated with [Stainless](https://www.stainless.com/).
42
+
43
+ ## Documentation
44
+
45
+ The REST API documentation can be found on [docs.isaacus.com](https://docs.isaacus.com). The full API of this library can be found in [api.md](https://github.com/isaacus-dev/isaacus-python/tree/main/api.md).
46
+
47
+ ## Installation
48
+
49
+ ```sh
50
+ # install from PyPI
51
+ pip install --pre isaacus
52
+ ```
53
+
54
+ ## Usage
55
+
56
+ The full API of this library can be found in [api.md](https://github.com/isaacus-dev/isaacus-python/tree/main/api.md).
57
+
58
+ ```python
59
+ import os
60
+ from isaacus import Isaacus
61
+
62
+ client = Isaacus(
63
+ api_key=os.environ.get("ISAACUS_API_KEY"), # This is the default and can be omitted
64
+ )
65
+
66
+ universal_classification = client.classifications.universal.create(
67
+ model="kanon-universal-classifier",
68
+ query="This is a confidentiality clause.",
69
+ text="I agree not to tell anyone about the document.",
70
+ )
71
+ print(universal_classification.chunks)
72
+ ```
73
+
74
+ While you can provide an `api_key` keyword argument,
75
+ we recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)
76
+ to add `ISAACUS_API_KEY="My API Key"` to your `.env` file
77
+ so that your API Key is not stored in source control.
78
+
79
+ ## Async usage
80
+
81
+ Simply import `AsyncIsaacus` instead of `Isaacus` and use `await` with each API call:
82
+
83
+ ```python
84
+ import os
85
+ import asyncio
86
+ from isaacus import AsyncIsaacus
87
+
88
+ client = AsyncIsaacus(
89
+ api_key=os.environ.get("ISAACUS_API_KEY"), # This is the default and can be omitted
90
+ )
91
+
92
+
93
+ async def main() -> None:
94
+ universal_classification = await client.classifications.universal.create(
95
+ model="kanon-universal-classifier",
96
+ query="This is a confidentiality clause.",
97
+ text="I agree not to tell anyone about the document.",
98
+ )
99
+ print(universal_classification.chunks)
100
+
101
+
102
+ asyncio.run(main())
103
+ ```
104
+
105
+ Functionality between the synchronous and asynchronous clients is otherwise identical.
106
+
107
+ ## Using types
108
+
109
+ 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:
110
+
111
+ - Serializing back into JSON, `model.to_json()`
112
+ - Converting to a dictionary, `model.to_dict()`
113
+
114
+ Typed requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.
115
+
116
+ ## Handling errors
117
+
118
+ When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `isaacus.APIConnectionError` is raised.
119
+
120
+ When the API returns a non-success status code (that is, 4xx or 5xx
121
+ response), a subclass of `isaacus.APIStatusError` is raised, containing `status_code` and `response` properties.
122
+
123
+ All errors inherit from `isaacus.APIError`.
124
+
125
+ ```python
126
+ import isaacus
127
+ from isaacus import Isaacus
128
+
129
+ client = Isaacus()
130
+
131
+ try:
132
+ client.classifications.universal.create(
133
+ model="kanon-universal-classifier",
134
+ query="This is a confidentiality clause.",
135
+ text="I agree not to tell anyone about the document.",
136
+ )
137
+ except isaacus.APIConnectionError as e:
138
+ print("The server could not be reached")
139
+ print(e.__cause__) # an underlying Exception, likely raised within httpx.
140
+ except isaacus.RateLimitError as e:
141
+ print("A 429 status code was received; we should back off a bit.")
142
+ except isaacus.APIStatusError as e:
143
+ print("Another non-200-range status code was received")
144
+ print(e.status_code)
145
+ print(e.response)
146
+ ```
147
+
148
+ Error codes are as follows:
149
+
150
+ | Status Code | Error Type |
151
+ | ----------- | -------------------------- |
152
+ | 400 | `BadRequestError` |
153
+ | 401 | `AuthenticationError` |
154
+ | 403 | `PermissionDeniedError` |
155
+ | 404 | `NotFoundError` |
156
+ | 422 | `UnprocessableEntityError` |
157
+ | 429 | `RateLimitError` |
158
+ | >=500 | `InternalServerError` |
159
+ | N/A | `APIConnectionError` |
160
+
161
+ ### Retries
162
+
163
+ Certain errors are automatically retried 2 times by default, with a short exponential backoff.
164
+ Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,
165
+ 429 Rate Limit, and >=500 Internal errors are all retried by default.
166
+
167
+ You can use the `max_retries` option to configure or disable retry settings:
168
+
169
+ ```python
170
+ from isaacus import Isaacus
171
+
172
+ # Configure the default for all requests:
173
+ client = Isaacus(
174
+ # default is 2
175
+ max_retries=0,
176
+ )
177
+
178
+ # Or, configure per-request:
179
+ client.with_options(max_retries=5).classifications.universal.create(
180
+ model="kanon-universal-classifier",
181
+ query="This is a confidentiality clause.",
182
+ text="I agree not to tell anyone about the document.",
183
+ )
184
+ ```
185
+
186
+ ### Timeouts
187
+
188
+ By default requests time out after 1 minute. You can configure this with a `timeout` option,
189
+ which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object:
190
+
191
+ ```python
192
+ from isaacus import Isaacus
193
+
194
+ # Configure the default for all requests:
195
+ client = Isaacus(
196
+ # 20 seconds (default is 1 minute)
197
+ timeout=20.0,
198
+ )
199
+
200
+ # More granular control:
201
+ client = Isaacus(
202
+ timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0),
203
+ )
204
+
205
+ # Override per-request:
206
+ client.with_options(timeout=5.0).classifications.universal.create(
207
+ model="kanon-universal-classifier",
208
+ query="This is a confidentiality clause.",
209
+ text="I agree not to tell anyone about the document.",
210
+ )
211
+ ```
212
+
213
+ On timeout, an `APITimeoutError` is thrown.
214
+
215
+ Note that requests that time out are [retried twice by default](https://github.com/isaacus-dev/isaacus-python/tree/main/#retries).
216
+
217
+ ## Advanced
218
+
219
+ ### Logging
220
+
221
+ We use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.
222
+
223
+ You can enable logging by setting the environment variable `ISAACUS_LOG` to `info`.
224
+
225
+ ```shell
226
+ $ export ISAACUS_LOG=info
227
+ ```
228
+
229
+ Or to `debug` for more verbose logging.
230
+
231
+ ### How to tell whether `None` means `null` or missing
232
+
233
+ In an API response, a field may be explicitly `null`, or missing entirely; in either case, its value is `None` in this library. You can differentiate the two cases with `.model_fields_set`:
234
+
235
+ ```py
236
+ if response.my_field is None:
237
+ if 'my_field' not in response.model_fields_set:
238
+ print('Got json like {}, without a "my_field" key present at all.')
239
+ else:
240
+ print('Got json like {"my_field": null}.')
241
+ ```
242
+
243
+ ### Accessing raw response data (e.g. headers)
244
+
245
+ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,
246
+
247
+ ```py
248
+ from isaacus import Isaacus
249
+
250
+ client = Isaacus()
251
+ response = client.classifications.universal.with_raw_response.create(
252
+ model="kanon-universal-classifier",
253
+ query="This is a confidentiality clause.",
254
+ text="I agree not to tell anyone about the document.",
255
+ )
256
+ print(response.headers.get('X-My-Header'))
257
+
258
+ universal = response.parse() # get the object that `classifications.universal.create()` would have returned
259
+ print(universal.chunks)
260
+ ```
261
+
262
+ These methods return an [`APIResponse`](https://github.com/isaacus-dev/isaacus-python/tree/main/src/isaacus/_response.py) object.
263
+
264
+ The async client returns an [`AsyncAPIResponse`](https://github.com/isaacus-dev/isaacus-python/tree/main/src/isaacus/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
265
+
266
+ #### `.with_streaming_response`
267
+
268
+ The above interface eagerly reads the full response body when you make the request, which may not always be what you want.
269
+
270
+ 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.
271
+
272
+ ```python
273
+ with client.classifications.universal.with_streaming_response.create(
274
+ model="kanon-universal-classifier",
275
+ query="This is a confidentiality clause.",
276
+ text="I agree not to tell anyone about the document.",
277
+ ) as response:
278
+ print(response.headers.get("X-My-Header"))
279
+
280
+ for line in response.iter_lines():
281
+ print(line)
282
+ ```
283
+
284
+ The context manager is required so that the response will reliably be closed.
285
+
286
+ ### Making custom/undocumented requests
287
+
288
+ This library is typed for convenient access to the documented API.
289
+
290
+ If you need to access undocumented endpoints, params, or response properties, the library can still be used.
291
+
292
+ #### Undocumented endpoints
293
+
294
+ To make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other
295
+ http verbs. Options on the client will be respected (such as retries) when making this request.
296
+
297
+ ```py
298
+ import httpx
299
+
300
+ response = client.post(
301
+ "/foo",
302
+ cast_to=httpx.Response,
303
+ body={"my_param": True},
304
+ )
305
+
306
+ print(response.headers.get("x-foo"))
307
+ ```
308
+
309
+ #### Undocumented request params
310
+
311
+ If you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` request
312
+ options.
313
+
314
+ #### Undocumented response properties
315
+
316
+ To access undocumented response properties, you can access the extra fields like `response.unknown_prop`. You
317
+ can also get all the extra fields on the Pydantic model as a dict with
318
+ [`response.model_extra`](https://docs.pydantic.dev/latest/api/base_model/#pydantic.BaseModel.model_extra).
319
+
320
+ ### Configuring the HTTP client
321
+
322
+ You can directly override the [httpx client](https://www.python-httpx.org/api/#client) to customize it for your use case, including:
323
+
324
+ - Support for [proxies](https://www.python-httpx.org/advanced/proxies/)
325
+ - Custom [transports](https://www.python-httpx.org/advanced/transports/)
326
+ - Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality
327
+
328
+ ```python
329
+ import httpx
330
+ from isaacus import Isaacus, DefaultHttpxClient
331
+
332
+ client = Isaacus(
333
+ # Or use the `ISAACUS_BASE_URL` env var
334
+ base_url="http://my.test.server.example.com:8083",
335
+ http_client=DefaultHttpxClient(
336
+ proxy="http://my.test.proxy.example.com",
337
+ transport=httpx.HTTPTransport(local_address="0.0.0.0"),
338
+ ),
339
+ )
340
+ ```
341
+
342
+ You can also customize the client on a per-request basis by using `with_options()`:
343
+
344
+ ```python
345
+ client.with_options(http_client=DefaultHttpxClient(...))
346
+ ```
347
+
348
+ ### Managing HTTP resources
349
+
350
+ By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.
351
+
352
+ ```py
353
+ from isaacus import Isaacus
354
+
355
+ with Isaacus() as client:
356
+ # make requests here
357
+ ...
358
+
359
+ # HTTP client is now closed
360
+ ```
361
+
362
+ ## Versioning
363
+
364
+ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:
365
+
366
+ 1. Changes that only affect static types, without breaking runtime behavior.
367
+ 2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_
368
+ 3. Changes that we do not expect to impact the vast majority of users in practice.
369
+
370
+ We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
371
+
372
+ We are keen for your feedback; please open an [issue](https://www.github.com/isaacus-dev/isaacus-python/issues) with questions, bugs, or suggestions.
373
+
374
+ ### Determining the installed version
375
+
376
+ If you've upgraded to the latest version but aren't seeing any new features you were expecting then your python environment is likely still using an older version.
377
+
378
+ You can determine the version that is being used at runtime with:
379
+
380
+ ```py
381
+ import isaacus
382
+ print(isaacus.__version__)
383
+ ```
384
+
385
+ ## Requirements
386
+
387
+ Python 3.8 or higher.
388
+
389
+ ## Contributing
390
+
391
+ See [the contributing documentation](https://github.com/isaacus-dev/isaacus-python/tree/main/./CONTRIBUTING.md).
@@ -0,0 +1,37 @@
1
+ isaacus/__init__.py,sha256=Wgs-qjblN9tJvI22iWwi5CfiVvyn1drBPnTYhVj7cWk,2426
2
+ isaacus/_base_client.py,sha256=ORZD1WjSTLicI9Bv0nJdIF7OGDv0Wl4ySK0ygQ9AjM8,64958
3
+ isaacus/_client.py,sha256=6KsVmDsdSUmwEwF-4-KPWQ4E4HI0Mj_BEyZu3zEJAq4,15232
4
+ isaacus/_compat.py,sha256=VWemUKbj6DDkQ-O4baSpHVLJafotzeXmCQGJugfVTIw,6580
5
+ isaacus/_constants.py,sha256=S14PFzyN9-I31wiV7SmIlL5Ga0MLHxdvegInGdXH7tM,462
6
+ isaacus/_exceptions.py,sha256=L82uluhizzc94VydHIaJkNxkcG-2DAe74tNhrE2eN2A,3222
7
+ isaacus/_files.py,sha256=mf4dOgL4b0ryyZlbqLhggD3GVgDf6XxdGFAgce01ugE,3549
8
+ isaacus/_models.py,sha256=PDLSNsn3Umxm3UMZPgyBiyN308rRzzPX6F9NO9FU2vs,28943
9
+ isaacus/_qs.py,sha256=AOkSz4rHtK4YI3ZU_kzea-zpwBUgEY8WniGmTPyEimc,4846
10
+ isaacus/_resource.py,sha256=iP_oYhz5enCI58mK7hlwLoPMPh4Q5s8-KBv-jGfv2aM,1106
11
+ isaacus/_response.py,sha256=5v-mAgiP6X9EBGBvTYVdwuDjikiha-dc1dYmadIraCU,28795
12
+ isaacus/_streaming.py,sha256=tMBfwrfEFWm0v7vWFgjn_lizsoD70lPkYigIBuADaCM,10104
13
+ isaacus/_types.py,sha256=WCRAb8jikEJoOi8nza8l5NnOTKgZlpmN5fkiHoKoY08,6144
14
+ isaacus/_version.py,sha256=QJjcy70nF84gGyzXyErqJ9w4IC1WkeWzmFJHMM8KL9g,167
15
+ isaacus/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
+ isaacus/_utils/__init__.py,sha256=PNZ_QJuzZEgyYXqkO1HVhGkj5IU9bglVUcw7H-Knjzw,2062
17
+ isaacus/_utils/_logs.py,sha256=rwa1Yzjbs2JaFn9KQ06rH5c_GSNa--BVwWnWhvvT1tY,777
18
+ isaacus/_utils/_proxy.py,sha256=z3zsateHtb0EARTWKk8QZNHfPkqJbqwd1lM993LBwGE,1902
19
+ isaacus/_utils/_reflection.py,sha256=ZmGkIgT_PuwedyNBrrKGbxoWtkpytJNU1uU4QHnmEMU,1364
20
+ isaacus/_utils/_streams.py,sha256=SMC90diFFecpEg_zgDRVbdR3hSEIgVVij4taD-noMLM,289
21
+ isaacus/_utils/_sync.py,sha256=TpGLrrhRNWTJtODNE6Fup3_k7zrWm1j2RlirzBwre-0,2862
22
+ isaacus/_utils/_transform.py,sha256=tsSFOIZ7iczaUsMSGBD_iSFOOdUyT2xtkcq1xyF0L9o,13986
23
+ isaacus/_utils/_typing.py,sha256=nTJz0jcrQbEgxwy4TtAkNxuU0QHHlmc6mQtA6vIR8tg,4501
24
+ isaacus/_utils/_utils.py,sha256=8UmbPOy_AAr2uUjjFui-VZSrVBHRj6bfNEKRp5YZP2A,12004
25
+ isaacus/lib/.keep,sha256=wuNrz-5SXo3jJaJOJgz4vFHM41YH_g20F5cRQo0vLes,224
26
+ isaacus/resources/__init__.py,sha256=KjFBnZ_h6ej57WNjlTujjO7TMNC1wVbFNA19ryus-P4,669
27
+ isaacus/resources/classifications/__init__.py,sha256=tYSnDm-o0CVuTC95VoNJzOqHsb8jTzYmW8hdwW14K60,1158
28
+ isaacus/resources/classifications/classifications.py,sha256=Td5Gscg1PNJJeobxow_hJq_RicpFe3ibEYN0Gh3Kpsg,4018
29
+ isaacus/resources/classifications/universal.py,sha256=pL3vaJPQry54drZRYdIeUVvsabJ9XzW-gUNSCXCpdQA,10432
30
+ isaacus/types/__init__.py,sha256=OKfJYcKb4NObdiRObqJV_dOyDQ8feXekDUge2o_4pXQ,122
31
+ isaacus/types/classifications/__init__.py,sha256=GX6WFRzjx9qcuJhdRZjFLJRYMM4d5J8F5N-BUq4ZgP0,296
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.0a1.dist-info/METADATA,sha256=BrXtIEjg_sRIui0LI11CTyHLcV4EA14yF6qhVvIhlB8,13802
35
+ isaacus-0.1.0a1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
36
+ isaacus-0.1.0a1.dist-info/licenses/LICENSE,sha256=lUen4LYVFVGEVXBsntBAPsQsOWgMkno1e9WfgWkpZ-k,11337
37
+ isaacus-0.1.0a1.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.27.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2025 Isaacus
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.