From 7859a0cb1a72ab27b1898b5c34aecf9a179b1c19 Mon Sep 17 00:00:00 2001 From: Vianney Mixtur Date: Sun, 25 Oct 2026 18:01:46 +0100 Subject: [PATCH 1/9] S1 Set up the clairic package and tooling Turn the proof-of-concept project into the `clairic` package: hatchling build with a src layout, Python 3.10+, httpx and pydantic dependencies, ruff, pyright in strict mode, pytest, and a CI workflow running all checks on Python 3.10 to 3.14. Add the MIT license, a NOTICE crediting the Cloudflare documentation (CC BY 4.0) and the unofficial disclaimer. main.py is removed here because this commit drops the `requests` dependency it relies on; examples/invoice.py replaces it in S8. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 24 ++ .gitignore | 11 +- LICENSE | 21 ++ NOTICE | 18 ++ README.md | 5 + main.py | 56 ---- pyproject.toml | 74 ++++- src/clairic/__init__.py | 8 + src/clairic/py.typed | 0 tests/test_package.py | 7 + uv.lock | 571 +++++++++++++++++++++++++++++++-------- 11 files changed, 615 insertions(+), 180 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 LICENSE create mode 100644 NOTICE delete mode 100644 main.py create mode 100644 src/clairic/__init__.py create mode 100644 src/clairic/py.typed create mode 100644 tests/test_package.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..94d5f68 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,24 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + +jobs: + checks: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] + steps: + - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v6 + with: + python-version: ${{ matrix.python-version }} + - run: uv sync --locked + - run: uv run ruff format --check + - run: uv run ruff check + - run: uv run pyright + - run: uv run pytest diff --git a/.gitignore b/.gitignore index f5a5bc1..dabc8b7 100644 --- a/.gitignore +++ b/.gitignore @@ -11,7 +11,12 @@ wheels/ # Environment variables .env -# Brainstorm and review notes -.cursor/brainstorms/ -.claude/skills/ \ No newline at end of file +# Tooling caches +.pytest_cache/ +.ruff_cache/ + +# Local agent notes and skills +.cursor/brainstorms/ +.cursor/plans/ +.claude/skills/ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..2e59e7c --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Vianney Mixtur + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/NOTICE b/NOTICE new file mode 100644 index 0000000..4586c51 --- /dev/null +++ b/NOTICE @@ -0,0 +1,18 @@ +clairic is an unofficial project. It is not affiliated with, endorsed by, or +supported by Cloudflare, Inc. "Cloudflare", "Workers AI" and "Clairic" are +names of Cloudflare, Inc. products. + +Docstrings in this package adapt text from the Cloudflare documentation, +which Cloudflare publishes under the Creative Commons Attribution 4.0 +International license (CC BY 4.0, https://creativecommons.org/licenses/by/4.0/). +The adapted text was edited for length and context. Sources: + +- Clairic model reference + https://developers.cloudflare.com/workers-ai/models/clairic/ +- Clairic input and output JSON schemas + https://developers.cloudflare.com/workers-ai/models/clairic/schema-input.json + https://developers.cloudflare.com/workers-ai/models/clairic/schema-output.json +- Extraction models concepts + https://developers.cloudflare.com/workers-ai/concepts/extraction-models/ +- "Clairic" launch post, The Cloudflare Blog + https://blog.cloudflare.com/clairic-extraction-model/ diff --git a/README.md b/README.md index e69de29..1481dde 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,5 @@ +# clairic + +**Unofficial** typed Python SDK for [Cloudflare Clairic](https://developers.cloudflare.com/workers-ai/models/clairic/), the Workers AI extraction model. This project is not affiliated with or endorsed by Cloudflare. + +Usage documentation lands with the first release. diff --git a/main.py b/main.py deleted file mode 100644 index f9f33af..0000000 --- a/main.py +++ /dev/null @@ -1,56 +0,0 @@ - -import json -import os - -import requests -from dotenv import load_dotenv - -load_dotenv() -ACCOUNT_ID = os.environ.get("ACCOUNT_ID") -AUTH_TOKEN = os.environ.get("CLOUDFLARE_AUTH_TOKEN") - -print(f"ACCOUNT_ID: {ACCOUNT_ID}") -print(f"AUTH_TOKEN: {AUTH_TOKEN}") - -def main(): - print("Hello from system-one-extract!") - - - - response = requests.post( - f"https://api.cloudflare.com/client/v4/accounts/{ACCOUNT_ID}/ai/run/@cf/cloudflare/clairic", - headers={"Authorization": f"Bearer {AUTH_TOKEN}"}, - json={ - "model": "clairic", - "state": "Invoice INV-2291 from Northwind Supply, issued 2026-09-02, net 30. 4 pallets at $250.00 each, shipping $80.00. Contact: Dana Ruiz, Priya Shah.", - "fields": { - "invoice_number": {"type": "text"}, - "due_date": { - "type": "date", - "instructions": "Issue date plus the net payment days", - }, - "total": { - "type": "number", - "decimals": 2, - "unit": "USD", - "instructions": "Amount due including shipping", - }, - "contacts": {"type": "list", "items": "text"}, - "po_number": {"type": "text", "instructions": "Purchase order number"}, - "days_to_pay": { - "type": "estimate", - "min": 0, - "max": 120, - "step": 1, - "instructions": "Days after issue until this invoice is paid", - }, - }, - }, - ) - print(response.json()) - with open("response.json", "w") as f: - json.dump(response.json(), f) - - -if __name__ == "__main__": - main() diff --git a/pyproject.toml b/pyproject.toml index 33d3329..fbce245 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,74 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + [project] -name = "system-one-extract" +name = "clairic" version = "0.1.0" -description = "Add your description here" +description = "Unofficial typed Python SDK for Cloudflare's Clairic extraction model, built on Pydantic." readme = "README.md" -requires-python = ">=3.14" +authors = [{ name = "Vianney Mixtur", email = "vianney@consio.ai" }] +license = { file = "LICENSE" } +requires-python = ">=3.10" +classifiers = [ + "Development Status :: 3 - Alpha", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", + "Typing :: Typed", +] dependencies = [ - "python-dotenv>=1.2.4", - "requests>=2.34.2", + "httpx>=0.27", + "pydantic>=2.7", + "typing-extensions>=4.12", +] + +[dependency-groups] +dev = [ + "anyio>=4.4", + "pyright>=1.1.400", + "pytest>=8.3", + "python-dotenv>=1.0", + "ruff>=0.8", +] + +[tool.hatch.build.targets.wheel] +packages = ["src/clairic"] + +[tool.hatch.build.targets.sdist] +include = ["/src", "/LICENSE", "/NOTICE", "/README.md", "/pyproject.toml"] + +[tool.ruff] +line-length = 100 +target-version = "py310" + +[tool.ruff.lint] +select = ["E", "F", "W", "I", "B", "UP", "SIM", "RUF", "D"] +ignore = [ + "D100", "D104", "D105", "D107", # module, package, magic and __init__ docstrings are optional + "D203", "D213", # use D211 and D212 (Google style) ] + +[tool.ruff.lint.pydocstyle] +convention = "google" + +[tool.ruff.lint.per-file-ignores] +"tests/**" = ["D"] +"scripts/**" = ["D"] +"examples/**" = ["D"] + +[tool.pyright] +include = ["src", "tests", "scripts", "examples"] +pythonVersion = "3.10" +typeCheckingMode = "strict" + +[tool.pytest.ini_options] +testpaths = ["tests"] +markers = ["live: calls the real Cloudflare API (needs CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN)"] +addopts = "-m 'not live'" diff --git a/src/clairic/__init__.py b/src/clairic/__init__.py new file mode 100644 index 0000000..6d6116a --- /dev/null +++ b/src/clairic/__init__.py @@ -0,0 +1,8 @@ +"""Unofficial typed Python SDK for Cloudflare Clairic. + +Clairic is a Workers AI extraction model: it reads a text and returns typed values for named +fields, with confidence scores, probabilities of absence and percentile ranges. This package is +not affiliated with or endorsed by Cloudflare. + +See https://developers.cloudflare.com/workers-ai/models/clairic/ for the model reference. +""" diff --git a/src/clairic/py.typed b/src/clairic/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_package.py b/tests/test_package.py new file mode 100644 index 0000000..71e280c --- /dev/null +++ b/tests/test_package.py @@ -0,0 +1,7 @@ +import clairic + + +def test_package_docstring_states_it_is_unofficial() -> None: + """Should state in the package docstring that the SDK is unofficial.""" + assert clairic.__doc__ is not None + assert "Unofficial" in clairic.__doc__ diff --git a/uv.lock b/uv.lock index cd9ca84..a75c66b 100644 --- a/uv.lock +++ b/uv.lock @@ -1,6 +1,29 @@ version = 1 revision = 3 -requires-python = ">=3.14" +requires-python = ">=3.10" + +[[package]] +name = "annotated-types" +version = "0.8.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/5f/56/a8120250d128bed162cd73c76d45f6ef9991f3e068f62a8ee060afa3104a/annotated_types-0.8.0.tar.gz", hash = "sha256:13b2beaad985e05e2d6407ee4c4f35590b11f8d693a258a561055cac8f64cab7", size = 15893, upload-time = "2026-07-23T20:16:13.995Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/99/91/8acff4f5e50511b911bbccb72b8628a49c68ce14148cd9f6431094859a90/annotated_types-0.8.0-py3-none-any.whl", hash = "sha256:f072f4d804ea359e4eaf198b1af7a8b0943881a87f31bb764f8bf219bb9419e0", size = 13427, upload-time = "2026-07-23T20:16:12.938Z" }, +] + +[[package]] +name = "anyio" +version = "4.15.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "exceptiongroup", marker = "python_full_version < '3.11'" }, + { name = "idna" }, + { name = "typing-extensions", marker = "python_full_version < '3.15'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/a9/d2/f4d173e22df740bc37b1db102b386ba719b66e95b0f0d751f556b387e6d2/anyio-4.15.1.tar.gz", hash = "sha256:9f28306018cbd6d329e64a36d58256edff76dd996fe423bc957326e578b82a94", size = 276966, upload-time = "2026-09-05T10:42:39.44Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/12/b8/4bd346e22b28902df4d651910f5242c28d84e4a5c2435ca5c3f797ed7e2e/anyio-4.15.1-py3-none-any.whl", hash = "sha256:6152fdbbf9a77fdec97731721bebf7c4c44f7c29b424b0065826173efc7ed101", size = 132079, upload-time = "2026-09-05T10:42:37.923Z" }, +] [[package]] name = "certifi" @@ -12,97 +35,96 @@ wheels = [ ] [[package]] -name = "charset-normalizer" -version = "3.5.2" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/33/1c/f41d4e74c28ab327ff3acd36053f7ea506c55872d7a90b0fa71aa3ab0c89/charset_normalizer-3.5.2.tar.gz", hash = "sha256:39de2a259fc954455c57274dc94c79d5842774e1247a016aff30bc0efed0f4ef", size = 172659, upload-time = "2026-09-30T04:39:23.398Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/58/ca/7aa91362a2f77ac8e9e28a9b902a74f7d0e11a851ef0d27a74308da8cd90/charset_normalizer-3.5.2-cp314-cp314-android_24_arm64_v8a.whl", hash = "sha256:1afb975bd5d68d5ce9f6b6d44fdf2f7e34b895a35e95708a7a91b20a3b51d187", size = 226010, upload-time = "2026-09-30T04:36:27.669Z" }, - { url = "https://files.pythonhosted.org/packages/a8/cf/ac8878d0322cf88a1aad4c7b147db32ca0bd806eb0060957b2e31486dbe6/charset_normalizer-3.5.2-cp314-cp314-android_24_x86_64.whl", hash = "sha256:bbbfc8e28816f19d7c0f1816664980c0a9875d01b27cdf8eedddb639d9e108ad", size = 239266, upload-time = "2026-09-30T04:36:29.434Z" }, - { url = "https://files.pythonhosted.org/packages/c9/6d/9a08d7e0b29b7208e2c6c01dc56c8e0520e7c7beadbbfb024b58fd69c8a5/charset_normalizer-3.5.2-cp314-cp314-ios_13_0_arm64_iphoneos.whl", hash = "sha256:7967d08cf06dee78443b874f98c98036f624f3a4e73e11f9f64f5be4d25393cf", size = 206783, upload-time = "2026-09-30T04:36:30.872Z" }, - { url = "https://files.pythonhosted.org/packages/82/44/b0aa350280e6ff5a5492d17cf10460dd39d5ee848f872f7ba2df10607f60/charset_normalizer-3.5.2-cp314-cp314-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:4c2b5031f63e331e3839b40aed2dd6f191e9c07edbde303e7876846ea1946995", size = 210449, upload-time = "2026-09-30T04:36:32.625Z" }, - { url = "https://files.pythonhosted.org/packages/7c/8a/40db9aa9f5907bb0e6f8b6d64064bf8852fb33d4b813ff9414911df7647c/charset_normalizer-3.5.2-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:fcff63213e8e6e47770541a4607175404f47cbb3ebea7b6058cc82d524a0e424", size = 367815, upload-time = "2026-09-30T04:36:34.197Z" }, - { url = "https://files.pythonhosted.org/packages/7f/72/9c5e7707b57c8ddfa9ddf7b0b1d009d7fbab9e9e887d5b721060f37e307d/charset_normalizer-3.5.2-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8d86d6fc60743dc916eb79e2eb1ec4818e21e427731543af40a3021851174a13", size = 247095, upload-time = "2026-09-30T04:36:35.803Z" }, - { url = "https://files.pythonhosted.org/packages/83/09/71e453691e927de4ddf792770cfaab3f49d494e222f66ea5e404bbd5e39c/charset_normalizer-3.5.2-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:7a881931aa470808df94a8c380eed2bbbc76cd9dc622310f99665658c821eb6d", size = 233942, upload-time = "2026-09-30T04:36:37.407Z" }, - { url = "https://files.pythonhosted.org/packages/9f/86/85c84e4da8b27dd409577d9437926ff581c5f9d3c66038dc68c1a526de51/charset_normalizer-3.5.2-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:8024d00c3faf3fc0c16e07a69f4405e8eac7cc0ab15f65fe6cf43827c4cf72b4", size = 273762, upload-time = "2026-09-30T04:36:38.904Z" }, - { url = "https://files.pythonhosted.org/packages/92/08/564955a4b5f2ccb410ab480bbe8c6a18063ff27f2d35458731c4a5335df9/charset_normalizer-3.5.2-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:4d48f2d08b9de5864e2c8744d4461b862fb149a18274abc8b698c45975573438", size = 269514, upload-time = "2026-09-30T04:36:40.469Z" }, - { url = "https://files.pythonhosted.org/packages/18/24/bad3ac4271589df29cf5ce2f5ae490518a5739358052bd0d61209e6fea54/charset_normalizer-3.5.2-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:34276fd796040bf0993ab33a369aa572e6979c7aab225a88893667ad8eac8f7a", size = 255056, upload-time = "2026-09-30T04:36:42.02Z" }, - { url = "https://files.pythonhosted.org/packages/d6/3e/350d89ad49916b86554d6f5f2d03ec1152148f87e5ff735106c6a03b1a36/charset_normalizer-3.5.2-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:0521c5665880b33d603717defa76c094048900010897909952397feb3039da56", size = 251311, upload-time = "2026-09-30T04:36:43.577Z" }, - { url = "https://files.pythonhosted.org/packages/56/5b/4970a2d154df502e133402906dd04e3ae7cada7b3011283c88d0479a2585/charset_normalizer-3.5.2-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:eff0ac9dbe711a4aee69bf04a83896aa9b85f19641264053a9f6d48573abb7dd", size = 250190, upload-time = "2026-09-30T04:36:45.185Z" }, - { url = "https://files.pythonhosted.org/packages/88/8c/f1a91bddc8fb47c2889e29ea7ea49a194eb0d9868675d786806519c00d76/charset_normalizer-3.5.2-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:1503bccbeb36d5527790c3930327704c39af22de3112f1b1666a9f3ce15ee204", size = 237098, upload-time = "2026-09-30T04:36:46.689Z" }, - { url = "https://files.pythonhosted.org/packages/24/0e/bb5dace3cc7e79068425386a6589c19b5a2ab5fefc2a46abea6919683332/charset_normalizer-3.5.2-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:52aa6992700996af31f375de0c6bacd402b0097fe40b53c426b9f51a90ebabc7", size = 274228, upload-time = "2026-09-30T04:36:48.31Z" }, - { url = "https://files.pythonhosted.org/packages/9d/79/b849ad523017ea9f5a45581bbebed91439e0cf42fd2860a6f64e358eb5a6/charset_normalizer-3.5.2-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:e09a3942ecbdee5cce73ea9d42da82b81b72ac1bf031ce069b93b5adf4eac8cd", size = 252401, upload-time = "2026-09-30T04:36:50.091Z" }, - { url = "https://files.pythonhosted.org/packages/89/8c/75469d690cf47200bce8f6cad7655724fc23148e147abfc5ce78b5f65863/charset_normalizer-3.5.2-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:c7c9ab723cde841fefb34efbad91e87f00a674b1fe1cd0784fde742bf2c154dc", size = 271846, upload-time = "2026-09-30T04:36:51.719Z" }, - { url = "https://files.pythonhosted.org/packages/26/cd/6d52d3c7437cdcf2e310ce9f28f282e733d4ef60ed19105d1819c356255f/charset_normalizer-3.5.2-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:ddc7dacc8ece3a182e7f15cb862d1fd616b46d076cb1ae9dd232b2c38b655874", size = 258151, upload-time = "2026-09-30T04:36:53.234Z" }, - { url = "https://files.pythonhosted.org/packages/f7/4c/070b38bdb5f49a70199fce923ec0726a49536a63ab262abbfcaaf351110b/charset_normalizer-3.5.2-cp314-cp314-pyemscripten_2026_0_wasm32.whl", hash = "sha256:ee43c17b173d46a3212baa6ead3ae258eeabdae48c263a01ccf0218c366dd655", size = 143570, upload-time = "2026-09-30T04:36:54.816Z" }, - { url = "https://files.pythonhosted.org/packages/81/84/9ebfc8ed6c8c4fcd8e726ff6bf220cc8deb3966e31dce9be8dd8aa017e64/charset_normalizer-3.5.2-cp314-cp314-win32.whl", hash = "sha256:4f87960d57feabfb618e4e0af6e7371645fa26a277860739d6e5d6e0012c92f0", size = 186412, upload-time = "2026-09-30T04:36:56.643Z" }, - { url = "https://files.pythonhosted.org/packages/d1/78/5ed86f743d4bc350db307e7636419a0a5ee1d91806d30c7f667bd5c80dae/charset_normalizer-3.5.2-cp314-cp314-win_amd64.whl", hash = "sha256:e4e81e09c1578b8df602e3db08b0b3ea0a6947ad612f52bf8dc5ea8d47691f0c", size = 210965, upload-time = "2026-09-30T04:36:58.205Z" }, - { url = "https://files.pythonhosted.org/packages/53/94/a3a7698e9b1a395e1eb99ccd9a324be9347973bff4e72db2a06496d7cd27/charset_normalizer-3.5.2-cp314-cp314-win_arm64.whl", hash = "sha256:80d02b6f04e92601a081dd97b23d3128033098bff5d35d392ddcc0476ea11253", size = 200406, upload-time = "2026-09-30T04:36:59.764Z" }, - { url = "https://files.pythonhosted.org/packages/c1/48/c5dd00d5ef7791f02666de250a5bb6071e29b7e133cf4b835800b6d3bc27/charset_normalizer-3.5.2-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:dca9ab98072a5a54ebacebdc45f53e645336b320c667410b061be1ca588ae709", size = 396871, upload-time = "2026-09-30T04:37:01.543Z" }, - { url = "https://files.pythonhosted.org/packages/12/c8/8379554b42e8368161d898476686947a0fdbd3e8865170d7909dcabfdee8/charset_normalizer-3.5.2-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f0aa869112ef88429ae17820d99c3dd9504c9e9c671d3c246f3d7442cb051084", size = 249711, upload-time = "2026-09-30T04:37:03.111Z" }, - { url = "https://files.pythonhosted.org/packages/4a/eb/2ddb1035d17320caa9f41682935123a9a250277b261c3efc86b2d2a21343/charset_normalizer-3.5.2-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:c0afc6800ba57ccc350374c5bd6150419915d95ce93cdbab2d783d75eaf30ecb", size = 231146, upload-time = "2026-09-30T04:37:04.721Z" }, - { url = "https://files.pythonhosted.org/packages/4a/24/2ecb4bde104322cd7859d6594fcfa74649f8d90b3221c9feecbef149875b/charset_normalizer-3.5.2-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:7dcd882da75ef9adf94903b1e3b9419e8aa8fb4c7396822b834b9ef7fb96954f", size = 271552, upload-time = "2026-09-30T04:37:06.295Z" }, - { url = "https://files.pythonhosted.org/packages/3f/98/9d5f6ebc3aee9fef5d30b4aff11fb2ab7a1222b4064f8ef2c7c87cde217a/charset_normalizer-3.5.2-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:2e06a3a98f916dd41d27f3105e02e7a40181c98c94b9158733d03a6f80506c09", size = 269810, upload-time = "2026-09-30T04:37:07.905Z" }, - { url = "https://files.pythonhosted.org/packages/09/e1/a3b06a10461b1b7628853c934c644e03bc28e42767116afb52f19a56519b/charset_normalizer-3.5.2-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6bd128f206a7752ae1f2ab6c61bf8a24ba28913a10df8b14c2637b973ff97a80", size = 259845, upload-time = "2026-09-30T04:37:09.554Z" }, - { url = "https://files.pythonhosted.org/packages/fd/d3/6f561f74a296cf27d61775a1dc665ad13f3bff6a798810ca05907f37a7c4/charset_normalizer-3.5.2-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:c8f3d67aeaf55f017982b73683f0e7342ba2f6635a78f69ce89ebb26aa411e5c", size = 252825, upload-time = "2026-09-30T04:37:11.274Z" }, - { url = "https://files.pythonhosted.org/packages/26/9f/69e13ca3b18f43e0eafcd34c04a45b732ae22a43b54a5fc9e119103356eb/charset_normalizer-3.5.2-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:fe9753dfee015c570d73df76f899f18444d41388bffcde097deba51c4fadbb9f", size = 252659, upload-time = "2026-09-30T04:37:12.941Z" }, - { url = "https://files.pythonhosted.org/packages/73/a9/ace29806a0dae18939919c76ba526472d83214afa101105fabff2cf30625/charset_normalizer-3.5.2-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:92888bb3187c5ba50500b00b3b310c9f2c651709d28036077680cb5255450a03", size = 238819, upload-time = "2026-09-30T04:37:14.659Z" }, - { url = "https://files.pythonhosted.org/packages/f8/c1/6116d52a2e3311ec80f21f5fb5e17b27405f10b9608af8f6e69516841a1b/charset_normalizer-3.5.2-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:d008d90a7f2471519aef0c90dfbe73b3e6e4d5e66ac48e19154c17e89e98b604", size = 272973, upload-time = "2026-09-30T04:37:16.346Z" }, - { url = "https://files.pythonhosted.org/packages/19/aa/9955c7e93bba10a9c7e8f7a5031b7ced66f3a1883a55c00712b8d5850ff3/charset_normalizer-3.5.2-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:31f3930700408d211f13378ccbe1c40845d8da54bd0681fac3a9b5aae81c7aa8", size = 253692, upload-time = "2026-09-30T04:37:18.212Z" }, - { url = "https://files.pythonhosted.org/packages/bb/33/2a6ae7fdc1b10cb581cef91addd8cdfc5f40d50abb5702309369d5834579/charset_normalizer-3.5.2-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:2a925889534b3748302dae5dead07cc13480de1dac3aea80a941b729b471ef93", size = 268757, upload-time = "2026-09-30T04:37:19.877Z" }, - { url = "https://files.pythonhosted.org/packages/a2/22/80992720a0282cd39bba1db35868e6b9c22f41281160143a836544bc1d8a/charset_normalizer-3.5.2-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:f5ec61164adcec446f8969a3358ec3f9b26bbda3b9213e5586d219afa8df2915", size = 262220, upload-time = "2026-09-30T04:37:21.583Z" }, - { url = "https://files.pythonhosted.org/packages/92/9f/181fd07e1bffea1d95cd80c84ac537354f50699c22cfc4d3c02b6fc16208/charset_normalizer-3.5.2-cp314-cp314t-win32.whl", hash = "sha256:598a11a2c7ebaa5334bf698bf29568c9c390abac6a154d8170fedecd1cea38c5", size = 197797, upload-time = "2026-09-30T04:37:23.235Z" }, - { url = "https://files.pythonhosted.org/packages/49/1c/25d8415ec1c4f2f41f1680435e4c87cfb378ff2f677d950946f2a45d0632/charset_normalizer-3.5.2-cp314-cp314t-win_amd64.whl", hash = "sha256:7fdde2c9fd9e3eca40631e024664cf2584272cc8f96308cbe5fdfc930f51d8bc", size = 222765, upload-time = "2026-09-30T04:37:24.891Z" }, - { url = "https://files.pythonhosted.org/packages/3e/b4/46b48f013dadfc0d0d33b375438e31bdf5a989dc68389c6bf627054d4df9/charset_normalizer-3.5.2-cp314-cp314t-win_arm64.whl", hash = "sha256:d1befeed746d247c81127bb14de9dc3d30edb6e5976d34f83f86ed262b1d9105", size = 210985, upload-time = "2026-09-30T04:37:26.634Z" }, - { url = "https://files.pythonhosted.org/packages/ca/e9/34e597dee616d0b8ee4b34d29399e85c2204ade174157a48505d42baa4ff/charset_normalizer-3.5.2-cp315-cp315-macosx_10_15_universal2.whl", hash = "sha256:87475fabc8d9996fd9c27debb395e642e8c838d78a00b6e932227a0e06b81e26", size = 367676, upload-time = "2026-09-30T04:37:28.329Z" }, - { url = "https://files.pythonhosted.org/packages/60/9f/a5d1c91c0263745e2cd344c5a4415d787c575501ab1d449f1148ac6b495d/charset_normalizer-3.5.2-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9409a8bf35cf78353942504b24a57de3d75b708997a1e4bd8db71ac8633ce364", size = 248414, upload-time = "2026-09-30T04:37:30.167Z" }, - { url = "https://files.pythonhosted.org/packages/26/79/e697f77464748a3ee3cf490c83d592459400d4898380d66c38366b03080c/charset_normalizer-3.5.2-cp315-cp315-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:498dc3188ca05a68231ac3fdbfc7f57eb67e1343c30e0fea17f8218c1599b253", size = 244775, upload-time = "2026-09-30T04:37:31.964Z" }, - { url = "https://files.pythonhosted.org/packages/ca/87/3d42a42e18ea066e2513936fd678a00696e77878b5ae04528976abdbcb83/charset_normalizer-3.5.2-cp315-cp315-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:e242bb1c5e76e97dfa9e7f209a71e93a01d7f19ffdd5cfbb2e2d55b4f08f8ab0", size = 273877, upload-time = "2026-09-30T04:37:33.661Z" }, - { url = "https://files.pythonhosted.org/packages/c3/76/8a28136f3938ba9836f84280ce0c4d61ed1cf15a036b2034900c62634162/charset_normalizer-3.5.2-cp315-cp315-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:def79fa35ef0cef8d2accec024f4fdc7ead3012ff02f5215c783f39f03ef8cfc", size = 269455, upload-time = "2026-09-30T04:37:35.573Z" }, - { url = "https://files.pythonhosted.org/packages/a0/a1/4fbf5d0f0f1b2a080474c1cf9a2f12c4c6531bb0e8ba591055e846d2b4e9/charset_normalizer-3.5.2-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:3df041de8887954562c9b261cba85ca0e9ded74048daf125f45edcfaa4832229", size = 257336, upload-time = "2026-09-30T04:37:37.397Z" }, - { url = "https://files.pythonhosted.org/packages/ba/a2/8b50aa320adb880ad579518e6f718f24944804b42a88b83d267d5d444125/charset_normalizer-3.5.2-cp315-cp315-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:04851f73ae72b8413dddadb16a49dfee95263553741fd42d546f7d66907e6be5", size = 257584, upload-time = "2026-09-30T04:37:39.522Z" }, - { url = "https://files.pythonhosted.org/packages/a5/57/50e3fed84e175f40349bd0da7a4fce94c87f0378f52d74f511d89e0bdc20/charset_normalizer-3.5.2-cp315-cp315-musllinux_1_2_aarch64.whl", hash = "sha256:183b88127acdb4fabe59d951ab424faf1af7b63cdbb5f776186c1ea2ffcaed98", size = 251854, upload-time = "2026-09-30T04:37:41.23Z" }, - { url = "https://files.pythonhosted.org/packages/d6/54/f7fbb3493c9f49091213b9c2d6dd65800696f1ce1a3f196a4205f50417b1/charset_normalizer-3.5.2-cp315-cp315-musllinux_1_2_armv7l.whl", hash = "sha256:16fa0eccf81304b79c5cd87f9271c3b85dd9dd99245e4422ae9c0dd45e0f99d3", size = 248767, upload-time = "2026-09-30T04:37:42.883Z" }, - { url = "https://files.pythonhosted.org/packages/d9/37/b3a6385acc5a1e45b39ae9c90bfb9cf838a09b9dd37ef2740ab4c6b4a2eb/charset_normalizer-3.5.2-cp315-cp315-musllinux_1_2_ppc64le.whl", hash = "sha256:7441d755b7ab94f8d4eb3e43ec05482d760842fd263d003a99102d742cd835e2", size = 274479, upload-time = "2026-09-30T04:37:44.658Z" }, - { url = "https://files.pythonhosted.org/packages/89/44/809913e2cfd279e635a9294fdbbfb1b1dc62a8189d473d561f649fce98d8/charset_normalizer-3.5.2-cp315-cp315-musllinux_1_2_riscv64.whl", hash = "sha256:ca403d7e4798f525fdfc78e258820419cbbd0f0ecbab9de7840e3c017cf6b8cf", size = 258310, upload-time = "2026-09-30T04:37:46.529Z" }, - { url = "https://files.pythonhosted.org/packages/af/a2/f28400ab13359d91bd39179df8e149376b9bf36588e739a3a4f9de2b84b2/charset_normalizer-3.5.2-cp315-cp315-musllinux_1_2_s390x.whl", hash = "sha256:df29a0a7107f7011e77f4eebdddec4c7331e24d787a0b21a46d63bdf7445da95", size = 271100, upload-time = "2026-09-30T04:37:48.399Z" }, - { url = "https://files.pythonhosted.org/packages/e9/89/9bab37955edf0adb3b66f8a3a6617d9f2f487e0d56f295a6a286cb640aa6/charset_normalizer-3.5.2-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:f3c96f633825733f735c5a9cf21d21a257d8e1edf0b1cee0a064b9c424ca0f7d", size = 259936, upload-time = "2026-09-30T04:37:50.023Z" }, - { url = "https://files.pythonhosted.org/packages/23/b5/4459e08d45a679f903d50fea08bc52cfa728cca4d7bd02c757b5e5abda2e/charset_normalizer-3.5.2-cp315-cp315-win32.whl", hash = "sha256:281cb91036248400f4cc957495cccd44c275c2e0c5854f7e45ac5cf7dc193847", size = 186301, upload-time = "2026-09-30T04:37:51.722Z" }, - { url = "https://files.pythonhosted.org/packages/98/e8/55d5fd3935b4bce6da4fe0df61898e8c82653e317e677bd58aceb9c60f13/charset_normalizer-3.5.2-cp315-cp315-win_amd64.whl", hash = "sha256:89b53f3cda69831909888e0494f4fa0bcd3537e3e138dabeb620bd6ad946bae8", size = 210858, upload-time = "2026-09-30T04:37:53.427Z" }, - { url = "https://files.pythonhosted.org/packages/a9/5b/974423c2fd8e524c7a7f64318c1e02240ef954912fa2b4d70344107b9c68/charset_normalizer-3.5.2-cp315-cp315-win_arm64.whl", hash = "sha256:6be488a102b8cf28d0391d8c4ba7748938ae28b78ad901f8585520fca33ead1a", size = 200309, upload-time = "2026-09-30T04:37:55.015Z" }, - { url = "https://files.pythonhosted.org/packages/ee/f9/00ee0195db1013d8f7c416fd770fbeb560bb46eb2e36b054d05cb56f6cfa/charset_normalizer-3.5.2-cp315-cp315t-macosx_10_15_universal2.whl", hash = "sha256:915563965d418f986e7e145accc592eae9e1a1be3566ff98a05d7a9ec42a76e1", size = 395343, upload-time = "2026-09-30T04:37:56.743Z" }, - { url = "https://files.pythonhosted.org/packages/04/3a/c00b50e94c964cf934c7899cd47c97952fc11dad71cc5884b3c61795b09b/charset_normalizer-3.5.2-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:65cd72beeeca9d3aaea1201e5923859f308f952f9c71de93f06063c79f0f7a3b", size = 250114, upload-time = "2026-09-30T04:37:58.607Z" }, - { url = "https://files.pythonhosted.org/packages/50/27/d102dc880bbcffd0479ab64dfc1fb96777a854355a55e2bda72a71efadcb/charset_normalizer-3.5.2-cp315-cp315t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:b7fd005a73d9e657273b7a10dc71a9e03c8fb9ee6999798d6918ce095b81ac7f", size = 239997, upload-time = "2026-09-30T04:38:00.511Z" }, - { url = "https://files.pythonhosted.org/packages/a5/4a/bf7ef45794dd293fab5f98a9309817977fbb845b9998f171b8cc5d8437a3/charset_normalizer-3.5.2-cp315-cp315t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:e54da4baf05720032d527874d40b65fa4d7e5c6c6a43d0c3adbeffcaf275a2b3", size = 272313, upload-time = "2026-09-30T04:38:02.509Z" }, - { url = "https://files.pythonhosted.org/packages/e8/ee/008a2837737991474c5754bb3191010007663860979701990982a502cbaf/charset_normalizer-3.5.2-cp315-cp315t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:124fbf1a8ff966d87ae05bb8bd45a71f966055ed8bba320d0c7cf450bc5f4d0e", size = 269986, upload-time = "2026-09-30T04:38:04.435Z" }, - { url = "https://files.pythonhosted.org/packages/93/ad/bd74a283940dc910c5b14f8e4f80a248082bc9c0fcbe1f54530cb6d9cc5e/charset_normalizer-3.5.2-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:28b4f0d66fb834ff90f28209ac7bce77868c45d8c93e26f906709d9b7c2e1af9", size = 260202, upload-time = "2026-09-30T04:38:06.549Z" }, - { url = "https://files.pythonhosted.org/packages/8a/7b/ed341c66f69f688723501fac752be3d63c7159ca0d0d4174fc611e5710bb/charset_normalizer-3.5.2-cp315-cp315t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:58ca3755ee7ff7f59b57789ec9833c9de9ea275405cdd240eda1f193112e398a", size = 259083, upload-time = "2026-09-30T04:38:08.311Z" }, - { url = "https://files.pythonhosted.org/packages/cc/9d/e41588b777965e5031a43128a1e96173ebb35ac75fc53ec3b517e7c21cd4/charset_normalizer-3.5.2-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:443eae2bf318abeaf6f15d785138f71fd6de770e99a92158b8b814265e079115", size = 253081, upload-time = "2026-09-30T04:38:10.402Z" }, - { url = "https://files.pythonhosted.org/packages/81/35/b761eb6d8c1eb218b9b42b9b4d5ac902afdc399fb6dac6f9a9aac7bda589/charset_normalizer-3.5.2-cp315-cp315t-musllinux_1_2_armv7l.whl", hash = "sha256:58f361dcbab699cf8f42db3f47c8e7fd1036f138c23a5d08de9fde5f425a730c", size = 248712, upload-time = "2026-09-30T04:38:12.317Z" }, - { url = "https://files.pythonhosted.org/packages/4d/2c/147169a041b747759f37405c0a97157e8e92de967968373101ff14915cba/charset_normalizer-3.5.2-cp315-cp315t-musllinux_1_2_ppc64le.whl", hash = "sha256:1b4cbc7c3491ccb4aa17fcd8165649d01cf39f76de1696da8631b5f71b85401d", size = 274176, upload-time = "2026-09-30T04:38:14.138Z" }, - { url = "https://files.pythonhosted.org/packages/f0/2d/0ff8db0d373ba8538db686db11cd7e8912031490b9e4f383b41912e8d594/charset_normalizer-3.5.2-cp315-cp315t-musllinux_1_2_riscv64.whl", hash = "sha256:ba0b1d2620edf869789c3879223f52bf2afc5d31b3cb47cc57b3a12c05e2aa9d", size = 259413, upload-time = "2026-09-30T04:38:15.841Z" }, - { url = "https://files.pythonhosted.org/packages/8a/8e/b4a085fb47c9d3a7e43576a4784fdd8fe23f907514a972de8086edaf7a48/charset_normalizer-3.5.2-cp315-cp315t-musllinux_1_2_s390x.whl", hash = "sha256:5e2b6b57e9733d39f0c9fd3185efa6b8e29652c4cd8fe94180272cf6ed9a78c4", size = 269434, upload-time = "2026-09-30T04:38:17.626Z" }, - { url = "https://files.pythonhosted.org/packages/83/1c/d8d8d7322a7c3eecdf3237a4a419cf41d2eaad8e006ce7dfdd9d4c8fa2eb/charset_normalizer-3.5.2-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:51cf45226a9b588d0d2b4880c62d686934b63ab0bd79ca23ab0e9762eb27441b", size = 262716, upload-time = "2026-09-30T04:38:19.214Z" }, - { url = "https://files.pythonhosted.org/packages/a0/16/0e4c6ba9b44e97a2da150e52d331e8f9c968b21b358fbffa6c856cebcd89/charset_normalizer-3.5.2-cp315-cp315t-win32.whl", hash = "sha256:5fb29fb8cd1a46c27a1bf9613ad5ec2599310d46b4025d9556404a6b6a292800", size = 197159, upload-time = "2026-09-30T04:38:21.037Z" }, - { url = "https://files.pythonhosted.org/packages/be/33/e90bc2b1374f7f36ef106f56620de5a783907e19ca857efe2277e31cac3e/charset_normalizer-3.5.2-cp315-cp315t-win_amd64.whl", hash = "sha256:a192e2c40070d92c3ccf777e3a5c4ff515573cd2bb7ed0c537fdadbbec5bbf21", size = 221322, upload-time = "2026-09-30T04:38:22.886Z" }, - { url = "https://files.pythonhosted.org/packages/66/89/dfa6dcb08c200b7830ab56439e8c1890f2971d51aafbb3937894a2e7fcfc/charset_normalizer-3.5.2-cp315-cp315t-win_arm64.whl", hash = "sha256:749e97e1b32313717a565abbe321bc2190bc8b35f1a67e4cdbc7c56c8d8ffe58", size = 209192, upload-time = "2026-09-30T04:38:24.648Z" }, - { url = "https://files.pythonhosted.org/packages/8c/ab/176fbfd5b64939c55d652366aa5b9ef1d767af207a3aa6ebeb0d226c484d/charset_normalizer-3.5.2-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:4275811936e2f06feff5e598fb42a1b7ae852da8e39605211892b56b81a34efd", size = 331815, upload-time = "2026-09-30T04:38:26.216Z" }, - { url = "https://files.pythonhosted.org/packages/7e/84/371eac6b30bdbcbf2d632a1a01809103459216fcaae61b8b8d922c1bfb8a/charset_normalizer-3.5.2-cp37-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:1c50fe28bbc2ced33386f298650d91218076c05420e6cbd790b913adc41659e7", size = 253276, upload-time = "2026-09-30T04:38:28.032Z" }, - { url = "https://files.pythonhosted.org/packages/43/6f/c4fbae58febff71709c51bc7e18fdfa55341dc382704740f9f0cbf03817b/charset_normalizer-3.5.2-cp37-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d19fbd981a488e22cd04883659ca6b08f50b5974f9fd7c95655ef6a043e5893f", size = 241239, upload-time = "2026-09-30T04:38:29.732Z" }, - { url = "https://files.pythonhosted.org/packages/61/71/458c3f42164a07d0c5210798e9e704b39e540a6793b05aba67f3a35243a9/charset_normalizer-3.5.2-cp37-abi3-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:0fed1d06615f022ee3b13caf5e8b180cfea32bb2c5aded8a9d44277afc040f93", size = 231121, upload-time = "2026-09-30T04:38:31.462Z" }, - { url = "https://files.pythonhosted.org/packages/09/54/ab9e89367076f6331bb6c65c4bf14a5361fa5191cb6561bf534f18504e1b/charset_normalizer-3.5.2-cp37-abi3-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:838dcc90063569a0448120554591a1d6c4a4ffe11babf048908793154ab86ade", size = 260350, upload-time = "2026-09-30T04:38:33.239Z" }, - { url = "https://files.pythonhosted.org/packages/7c/c1/061431ecc688d9d76602502cb57cc01e691e682c18f1beb45f9673b5bbd2/charset_normalizer-3.5.2-cp37-abi3-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:2ce45c6627b22c47e390bc91a41c3d13032192e699fa0bea96e9671b373d69b0", size = 255430, upload-time = "2026-09-30T04:38:34.865Z" }, - { url = "https://files.pythonhosted.org/packages/8d/1f/20c8949f0676f7ab811abdeb7f4d7f1cbc6e61ff20bef08b44edeb092bc8/charset_normalizer-3.5.2-cp37-abi3-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:0774bf9bf620249fee3e0b8b9fd3065de213be30f3aa94ce2494b3b638949e26", size = 250612, upload-time = "2026-09-30T04:38:36.649Z" }, - { url = "https://files.pythonhosted.org/packages/2b/9e/46f2fa4c431fc98c4ae76a8cb5bdca54e0341e3cfc3fcfd8e82740250818/charset_normalizer-3.5.2-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:1db38f4c5496827c1a501846d64d14c3b80c7e6714e406cd7dc36a9899fa1011", size = 242083, upload-time = "2026-09-30T04:38:38.26Z" }, - { url = "https://files.pythonhosted.org/packages/bd/39/559be29a0c0f086e0bba6922babd38916cc5e0b58ced4de13ee01ea05508/charset_normalizer-3.5.2-cp37-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:304d8e4d493af723536393eee0c689eb7813f4a474c8b479dee63f1fdd98f621", size = 232738, upload-time = "2026-09-30T04:38:39.81Z" }, - { url = "https://files.pythonhosted.org/packages/ff/6c/387b0e4f756a282831c1d9fc6aeb6c51ca4507ca202767c8de15ce9b12e2/charset_normalizer-3.5.2-cp37-abi3-musllinux_1_2_ppc64le.whl", hash = "sha256:9b7f416ff0978e2f2249330527f0ad6fa02f4932e6199692d3b52da2048c19e4", size = 260703, upload-time = "2026-09-30T04:38:41.346Z" }, - { url = "https://files.pythonhosted.org/packages/96/92/1fdf015f09ef449f50d3ac4b67c90887c9c318b727daa95cc4f866e6521d/charset_normalizer-3.5.2-cp37-abi3-musllinux_1_2_riscv64.whl", hash = "sha256:01077390b03f7988f11d700a2194e69b119741a86b1a638b1db88891e3eced8e", size = 247622, upload-time = "2026-09-30T04:38:42.937Z" }, - { url = "https://files.pythonhosted.org/packages/dc/3c/8e7b8a5671ad5d433669fb2a76f1a0164df2d9b1718b0206bc2a16d840cc/charset_normalizer-3.5.2-cp37-abi3-musllinux_1_2_s390x.whl", hash = "sha256:7e841fb9010836c992c9f12fcbd43a831de93a5f726fc1ccd8ca1d0268c5014c", size = 257500, upload-time = "2026-09-30T04:38:44.604Z" }, - { url = "https://files.pythonhosted.org/packages/b4/f0/45b579df5cabc1d5d53ea1cc35e8437d3ca768c0acccc7041517cb6fbb32/charset_normalizer-3.5.2-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:9cae88599c7219005d879f98e5ed53341e9a122af585e1091200358a3003d2a0", size = 255100, upload-time = "2026-09-30T04:38:46.289Z" }, - { url = "https://files.pythonhosted.org/packages/31/68/fdec18a343f5fb3f310588dd478b09ac4799e0b187dbade3a8cd776f03ef/charset_normalizer-3.5.2-cp37-abi3-win32.whl", hash = "sha256:01b0c0d2262a9e28e8484a278c7e1b5d650e3ac8cf2683d2967e25899f208bdf", size = 174499, upload-time = "2026-09-30T04:38:47.999Z" }, - { url = "https://files.pythonhosted.org/packages/9d/8a/b618149cc5207943a0242068d7a27897f56a62947b5a039085f2a22029f8/charset_normalizer-3.5.2-cp37-abi3-win_amd64.whl", hash = "sha256:9f56f72050826f63dcee7a7f55b0a77168cb3bfc553fd405e7f8f9ece75a4036", size = 200092, upload-time = "2026-09-30T04:38:49.707Z" }, - { url = "https://files.pythonhosted.org/packages/03/cf/4c66866fa9e2b1c78e3c911516d1de497a677b7ac60f1eceda74ce777ca3/charset_normalizer-3.5.2-cp37-abi3-win_arm64.whl", hash = "sha256:40ab6bffa02ae10a0581e6c198be7d2d8ca5c2a0c64e4ed3465d766df457573e", size = 294363, upload-time = "2026-09-30T04:38:51.312Z" }, - { url = "https://files.pythonhosted.org/packages/fc/ad/d07d7862a62ffa6d79d68074d14823243dd235a77c45262acbf6adeb28bf/charset_normalizer-3.5.2-py3-none-any.whl", hash = "sha256:b6b751274acb69d77b3323d6b7dbaa3c7fdfc1eb829b7eb61d262f32e1af9685", size = 68872, upload-time = "2026-09-30T04:39:21.828Z" }, +name = "clairic" +version = "0.1.0" +source = { editable = "." } +dependencies = [ + { name = "httpx" }, + { name = "pydantic" }, + { name = "typing-extensions" }, +] + +[package.dev-dependencies] +dev = [ + { name = "anyio" }, + { name = "pyright" }, + { name = "pytest" }, + { name = "python-dotenv" }, + { name = "ruff" }, +] + +[package.metadata] +requires-dist = [ + { name = "httpx", specifier = ">=0.27" }, + { name = "pydantic", specifier = ">=2.7" }, + { name = "typing-extensions", specifier = ">=4.12" }, +] + +[package.metadata.requires-dev] +dev = [ + { name = "anyio", specifier = ">=4.4" }, + { name = "pyright", specifier = ">=1.1.400" }, + { name = "pytest", specifier = ">=8.3" }, + { name = "python-dotenv", specifier = ">=1.0" }, + { name = "ruff", specifier = ">=0.8" }, +] + +[[package]] +name = "colorama" +version = "0.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697, upload-time = "2022-10-25T02:36:22.414Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" }, +] + +[[package]] +name = "exceptiongroup" +version = "1.3.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions", marker = "python_full_version < '3.13'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/50/79/66800aadf48771f6b62f7eb014e352e5d06856655206165d775e675a02c9/exceptiongroup-1.3.1.tar.gz", hash = "sha256:8b412432c6055b0b7d14c310000ae93352ed6754f70fa8f7c34141f91c4e3219", size = 30371, upload-time = "2025-11-21T23:01:54.787Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/8a/0e/97c33bf5009bdbac74fd2beace167cab3f978feb69cc36f1ef79360d6c4e/exceptiongroup-1.3.1-py3-none-any.whl", hash = "sha256:a7a39a3bd276781e98394987d3a5701d0c4edffb633bb7a5144577f82c773598", size = 16740, upload-time = "2025-11-21T23:01:53.443Z" }, +] + +[[package]] +name = "h11" +version = "0.16.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/01/ee/02a2c011bdab74c6fb3c75474d40b3052059d95df7e73351460c8588d963/h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1", size = 101250, upload-time = "2025-04-24T03:35:25.427Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/04/4b/29cac41a4d98d144bf5f6d33995617b185d14b22401f75ca86f384e87ff1/h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86", size = 37515, upload-time = "2025-04-24T03:35:24.344Z" }, +] + +[[package]] +name = "httpcore" +version = "1.0.9" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "certifi" }, + { name = "h11" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/06/94/82699a10bca87a5556c9c59b5963f2d039dbd239f25bc2a63907a05a14cb/httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8", size = 85484, upload-time = "2025-04-24T22:06:22.219Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7e/f5/f66802a942d491edb555dd61e3a9961140fd64c90bce1eafd741609d334d/httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55", size = 78784, upload-time = "2025-04-24T22:06:20.566Z" }, +] + +[[package]] +name = "httpx" +version = "0.28.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anyio" }, + { name = "certifi" }, + { name = "httpcore" }, + { name = "idna" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/b1/df/48c586a5fe32a0f01324ee087459e112ebb7224f646c0b5023f5e79e9956/httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc", size = 141406, upload-time = "2024-12-06T15:37:23.222Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/2a/39/e50c7c3a983047577ee07d2a9e53faf5a69493943ec3f6a384bdc792deb2/httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad", size = 73517, upload-time = "2024-12-06T15:37:21.509Z" }, ] [[package]] @@ -114,6 +136,244 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/58/a2/bb081bab032533a855d44de1d56f8e8426114ff1ba5d1f07a438a0a654f8/idna-3.20-py3-none-any.whl", hash = "sha256:ab7ae7122974553370f0bdb919e1a960b2cd1bc1ef0276416d896db81c14582c", size = 69583, upload-time = "2026-09-17T14:11:03.168Z" }, ] +[[package]] +name = "iniconfig" +version = "2.3.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/01/e1/2069291243c926a2ff1cd706c7f3eeb9b62144bf60f77c9fb9ff2fb26bd3/iniconfig-2.3.1.tar.gz", hash = "sha256:67f4b9c50da0dedf52af349e7749a80a9057a5031199791b906c3bb3ae878960", size = 21209, upload-time = "2026-10-06T22:48:38.076Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/56/43/4ca9e49d27a1fcf6bece6f6aec0ea46bb9112489b93d4b688fb415457bdb/iniconfig-2.3.1-py3-none-any.whl", hash = "sha256:9121e2c1fdb355232495be3194c8dfe87ccc2d5dee45947b78e68f499790d7a7", size = 7552, upload-time = "2026-10-06T22:48:36.959Z" }, +] + +[[package]] +name = "nodeenv" +version = "1.11.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/9a/8e/105de02c1322cfada6d9710d9146ef8026419d433c9d08359a2d35805811/nodeenv-1.11.0.tar.gz", hash = "sha256:3ce8fe5b71d16e8af7039ca65257354100bc772965d6bc549070649e53b1b146", size = 99301, upload-time = "2026-09-26T11:29:21.367Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/54/c8/12811c9b48fde162bb72b6f2e78fada9a247a09d7bb5be2050a5d099c77b/nodeenv-1.11.0-py2.py3-none-any.whl", hash = "sha256:edaa16e6c14d7cf395d75d4bbd5a26390f4dc06501a33b4e76282b02cc688a25", size = 34277, upload-time = "2026-09-26T11:29:19.933Z" }, +] + +[[package]] +name = "packaging" +version = "26.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/7d/fa/3944b40b07da9ce895c0e6303a5ab7d53da063554f534556b134a54d6093/packaging-26.3.tar.gz", hash = "sha256:94edc256424af38762eb31306eed28beb9f0efc50a8837492c9d6fd6004aed79", size = 313412, upload-time = "2026-08-04T18:15:28.737Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/63/34/ba1c580383c9eada3711951fef0795c80b829a078d72188184bcab9dd527/packaging-26.3-py3-none-any.whl", hash = "sha256:d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c", size = 129956, upload-time = "2026-08-04T18:15:27.159Z" }, +] + +[[package]] +name = "pluggy" +version = "1.7.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/bf/db/7fc19e6f2dc92a966727031389fc2e08b558f0f25eb7403c1119ad4713cd/pluggy-1.7.0.tar.gz", hash = "sha256:d1eaa46ebb595891b860ab086b4d09c8588af65ebd4361b8e8f4bb8920b90ba8", size = 123304, upload-time = "2026-10-15T09:50:58.343Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/40/9e/2b38731e0fc536806f16490e1a12d7f0dc2a1235aa8cc07bcc75416a7daa/pluggy-1.7.0-py3-none-any.whl", hash = "sha256:7dd7b0d8832ba3cb632c306926ded123429211b83641b35dc5c41ad2d34f9bec", size = 27082, upload-time = "2026-10-15T09:50:56.808Z" }, +] + +[[package]] +name = "pydantic" +version = "2.14.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "annotated-types" }, + { name = "pydantic-core" }, + { name = "typing-extensions" }, + { name = "typing-inspection" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/7c/0b/8e10b2e693af8ec54346a14caf36221334775975a747c9ceaa3f8371d96d/pydantic-2.14.1.tar.gz", hash = "sha256:94f478203dd03404682a1ada216965651dd74b1d2d5ffd62e00e0837caab5c26", size = 900362, upload-time = "2026-10-11T18:37:55.396Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/35/ea/a56b9fe5066f3537b7882f77e9c5dfb26d8c2eefdaed9b5fc73d57b4dc22/pydantic-2.14.1-py3-none-any.whl", hash = "sha256:9195d967ec791692a04438115466764fb8b9a27b31f14a760437694f40d6b454", size = 488106, upload-time = "2026-10-11T18:37:53.437Z" }, +] + +[[package]] +name = "pydantic-core" +version = "2.50.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/a6/24/af4ec4be49fbc810f35b0bdcacc3d433b56bbfa469fd3bfd4ae116cd9bf1/pydantic_core-2.50.1.tar.gz", hash = "sha256:e50d7b94baac6c7d09927fa5ca5800a0c7ee5015c7fcff65beb3a1931b5a6e09", size = 513515, upload-time = "2026-10-11T18:35:44.82Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/09/db/c9cc34707ba2c23ce90d54e8a4ee9307583ad054b9df2ce570ba550cb576/pydantic_core-2.50.1-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:b281a3b0f0822618fe5e3e0d8a2048b6356b14388505dc9374ccffeb69989713", size = 2154222, upload-time = "2026-10-11T18:31:38.345Z" }, + { url = "https://files.pythonhosted.org/packages/c1/17/6963f4ee55b7df7658f5c036c0f90baf8cd3d413f5d8b551f227e8467afc/pydantic_core-2.50.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:1fa4c8bc12c1354c5550c0c35c1852c8c1901e89e06561724e03f8d0342e1f87", size = 2048126, upload-time = "2026-10-11T18:31:41.061Z" }, + { url = "https://files.pythonhosted.org/packages/bf/be/f75637e222085d29a3076edbc5cfd0dd9b77d145e310ff7dc1150f07558a/pydantic_core-2.50.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3aa9de446b793de2beb6fa2d9d0961803126c4e2a99c2f25ab59b9fd6ea125c0", size = 2052460, upload-time = "2026-10-11T18:31:42.321Z" }, + { url = "https://files.pythonhosted.org/packages/7a/1e/3d192ffa39ce3bd0e98e988fb5c055cfbf4af6e6e155a4ca5baa86d1f2cc/pydantic_core-2.50.1-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:de531ce1e2a3364e8767878b58f4ff728a434b4fde089781fe30b1e08e2396e0", size = 2190750, upload-time = "2026-10-11T18:31:43.572Z" }, + { url = "https://files.pythonhosted.org/packages/b2/7e/12ea94df5220ab316ee5bb498ebcf710cff2db352653039fb6033f6997d1/pydantic_core-2.50.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a7c58106de36ac6a56314182958de20db8d3a29dfd5db527192cc754e4f8e7fb", size = 2390043, upload-time = "2026-10-11T18:31:44.745Z" }, + { url = "https://files.pythonhosted.org/packages/f6/bc/4fbb6dc90af038628ec824434a9841be9d46854f9267bb658f09e315024d/pydantic_core-2.50.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8b4c3df25bd323bf1d36a648d563cf1fc69d717451569927151bdad7cad07a77", size = 2432397, upload-time = "2026-10-11T18:31:46.186Z" }, + { url = "https://files.pythonhosted.org/packages/1b/1a/21a58791021397d9ca35295e3f4291c16e319155c5904334b89eb07e97e1/pydantic_core-2.50.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f77ac30b19221cd9bd3fcfa3d4614eff93140d0572ab730cded17b64adca05f3", size = 2160719, upload-time = "2026-10-11T18:31:47.557Z" }, + { url = "https://files.pythonhosted.org/packages/73/6a/d5b2c5876162fd2c444eaed0064b5d9d9d0ef0d31530fc6a7997e8685ad8/pydantic_core-2.50.1-cp310-cp310-manylinux_2_31_riscv64.whl", hash = "sha256:d939de9c82e2126f7f48a7e658f8a85ed46d57662d53f44c49b8895fe94a3eb7", size = 2256164, upload-time = "2026-10-11T18:31:48.797Z" }, + { url = "https://files.pythonhosted.org/packages/af/e8/1a6625d6e99250388dd0ae817c5d75839cd6103e7b790f59e0ffff74955d/pydantic_core-2.50.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:30ddf019d082c117b5d309e5b86710c2a78909907ec1a9381feec3eec02eca0b", size = 2271176, upload-time = "2026-10-11T18:31:49.987Z" }, + { url = "https://files.pythonhosted.org/packages/19/9f/bbdd137d7ec41284701dab4d1489ea597d401dff2f5f3e6b41ea872e0b12/pydantic_core-2.50.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:2ab756b72bd5054e4c7ef3ded331b35786cbd3cf931531a508f79a9537517064", size = 2304637, upload-time = "2026-10-11T18:31:51.251Z" }, + { url = "https://files.pythonhosted.org/packages/49/5d/7bd322e649b41b45130bc00bfa34dc57498c853aa8e6fc9604e33bc7087c/pydantic_core-2.50.1-cp310-cp310-musllinux_1_1_armv7l.whl", hash = "sha256:b087b1c5be7ac687cf22eabfe4b6b608d40df23610651e93611e1f49118baf84", size = 2467374, upload-time = "2026-10-11T18:31:52.587Z" }, + { url = "https://files.pythonhosted.org/packages/53/48/41a91111590eb7ba68a7c64c03139235a4b8349930abcb87931aa80da796/pydantic_core-2.50.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:a44101320cfe99432db74237545a63057dc7a88dfe792cbcad0647f2af56cb81", size = 2480832, upload-time = "2026-10-11T18:31:54.06Z" }, + { url = "https://files.pythonhosted.org/packages/2a/02/4ac93a3d3f0ff412df1a36a9619743336fe6eec68c0df8a914163a3d22b4/pydantic_core-2.50.1-cp310-cp310-win32.whl", hash = "sha256:a4aaaa791bdae1c972a7e81765f4f3571c926b8e0b9b6e47346499fb80079665", size = 2123154, upload-time = "2026-10-11T18:31:55.396Z" }, + { url = "https://files.pythonhosted.org/packages/6d/ba/3a7af3dcd480c4739aa82cd9fedee79a5531a7c553346abcf095bd05f0de/pydantic_core-2.50.1-cp310-cp310-win_amd64.whl", hash = "sha256:2eedf82ee4753cdab8e50044c6bd569577eebc3859b11fecf4eb9223761ff966", size = 2179366, upload-time = "2026-10-11T18:31:56.697Z" }, + { url = "https://files.pythonhosted.org/packages/45/1b/ca81811da3d2aea724fb3c4ba6b83f50ab8f210576306ccd601973142d35/pydantic_core-2.50.1-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:c531166c42ea7bdfecc8c50049581f05dd1993b09cc7c52bb36a14e96deaec7d", size = 2152145, upload-time = "2026-10-11T18:31:58.046Z" }, + { url = "https://files.pythonhosted.org/packages/59/20/938ef7e0541af0a314e2f9d63848dbd1656ba2ebfe5ca0469f7ebee00d5e/pydantic_core-2.50.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:b6d0c2183008c188e19f4906d426b293bdc4f67ab17df8e180fe16cda208fa71", size = 2045761, upload-time = "2026-10-11T18:31:59.35Z" }, + { url = "https://files.pythonhosted.org/packages/2f/4b/456497fe2affa18f49b226e89bde31e8a204751ee343dd9beaac5438123e/pydantic_core-2.50.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:94be440c03fede26969a5ce75468e0e6a9927a1b46d9b679ee8adc1b057b0350", size = 2049557, upload-time = "2026-10-11T18:32:01.121Z" }, + { url = "https://files.pythonhosted.org/packages/a5/9d/cd5dfe13928f55e236dff3a1bee06721d318ca6c955d9ca993b0a5d09f39/pydantic_core-2.50.1-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:36c426eac0af8d1529ff8467e612b933346caec1fdc0d774f78f67a1a11e16c1", size = 2188153, upload-time = "2026-10-11T18:32:02.442Z" }, + { url = "https://files.pythonhosted.org/packages/fb/8d/d0b25bc484f8d9136ea76ece69e0b2d24ab370cc2e7bbd1b79e61723b763/pydantic_core-2.50.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:028e2f212273d4a39b1ec1e0de8166b1165a65fc0f1111452a9d94fc7c625c63", size = 2388308, upload-time = "2026-10-11T18:32:03.767Z" }, + { url = "https://files.pythonhosted.org/packages/c5/64/6513cac7c9f78492abafa01d57a69de1d246bf3085fd7b0330bf14b025b3/pydantic_core-2.50.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e6f0cc1bb9900dc558960894adeb30b0c083366fc1d69b856209fb2ca5c36fe5", size = 2431187, upload-time = "2026-10-11T18:32:05.159Z" }, + { url = "https://files.pythonhosted.org/packages/ed/60/7f2ae89c37e69a3dc0da9ff57b0388c285542c688d05f36767770429de85/pydantic_core-2.50.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8812592c85d0edf423f10eadcef42716d71e8219085ad9e85b775057b7306133", size = 2157623, upload-time = "2026-10-11T18:32:06.616Z" }, + { url = "https://files.pythonhosted.org/packages/87/02/e3a71373b85a7973099b9a229a4302c7792262717e0b4997e41c01f7dd16/pydantic_core-2.50.1-cp311-cp311-manylinux_2_31_riscv64.whl", hash = "sha256:bbce99252ba3167b2b6277f1829d5bf4b43b754524bddf7f944707c3db7d2253", size = 2254539, upload-time = "2026-10-11T18:32:07.968Z" }, + { url = "https://files.pythonhosted.org/packages/3f/d5/5b620aaf40dc631d911565b64d49d3fa8422027c046a7a96dc4e4921ae98/pydantic_core-2.50.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:476f6ed8e43cd1e0b460920e23571700872b284e77331cb30c4faf459cf48a4b", size = 2267344, upload-time = "2026-10-11T18:32:09.399Z" }, + { url = "https://files.pythonhosted.org/packages/e0/48/f46baf4580d8a56ca4782aa65842e16d3cf39736b29fcce8e9c0521b3422/pydantic_core-2.50.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:2cbd1b75b09e976ed0d6b6ca297675632ca35df86130088457cdc60ef36970ae", size = 2300877, upload-time = "2026-10-11T18:32:10.903Z" }, + { url = "https://files.pythonhosted.org/packages/2b/9d/e7d28505e6092c1fe075838a4f793ccbe6dd676e44ab16175815ee06cfe0/pydantic_core-2.50.1-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:5958c72adb417c39b12ac87525ac60b0d73315fcdc59e21f44ee4a5e2512c9ef", size = 2464270, upload-time = "2026-10-11T18:32:12.329Z" }, + { url = "https://files.pythonhosted.org/packages/22/b1/3bf63b82efd93ebc9968f9c12fc46037a28bcb452c88e4688f33e5ff7dca/pydantic_core-2.50.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:d8f9e8a6c4ab04b78d61f78627370d834eb004b2869dcb28cfffa647b4ea1980", size = 2478653, upload-time = "2026-10-11T18:32:13.735Z" }, + { url = "https://files.pythonhosted.org/packages/28/17/26d1e4b9c2ba6a92b7dc75bbcb99ef44456b7e3af1bced868403667ea7d3/pydantic_core-2.50.1-cp311-cp311-win32.whl", hash = "sha256:4be846f55c9477f5f3ddde8f2ce941137e16862a56d018ed885d422bb6ae02f2", size = 2120246, upload-time = "2026-10-11T18:32:15.591Z" }, + { url = "https://files.pythonhosted.org/packages/24/65/3e875e7991eaecd4d70686293ff0d8a99aa8f93dc295e6a21c3d702912fb/pydantic_core-2.50.1-cp311-cp311-win_amd64.whl", hash = "sha256:0048b6dddc8ef4b64fccaad878bd143b0c3882ea9936279dc11d613f6b7dd1bc", size = 2176332, upload-time = "2026-10-11T18:32:17.153Z" }, + { url = "https://files.pythonhosted.org/packages/ab/5c/58dbd17c61f209d91c70f549eb7a3bbec7023e89ea12dead091462d6d658/pydantic_core-2.50.1-cp311-cp311-win_arm64.whl", hash = "sha256:6a733778df2f7087ec1100ed0b41533e4f3001976e99570fa34f57c66e7f8e3e", size = 2182471, upload-time = "2026-10-11T18:32:18.49Z" }, + { url = "https://files.pythonhosted.org/packages/ee/94/101b49a6c63f99586755690696eae14532772587d9e39e93f7b8d28a49da/pydantic_core-2.50.1-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:704075d10b74f2f3c6e15407c696d88701df35fc8953f434a431add0d0074db0", size = 2222428, upload-time = "2026-10-11T18:32:20.228Z" }, + { url = "https://files.pythonhosted.org/packages/db/a3/f8b1b39349c33037c73d7a1b794c9c29d8f07d5bd2b74399c1375a529cc6/pydantic_core-2.50.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:e8e1d6ce820aa23317e8209a86bd65a540973c12dc7552b48a4f6c8e9926815e", size = 2025779, upload-time = "2026-10-11T18:32:21.723Z" }, + { url = "https://files.pythonhosted.org/packages/d2/2d/862a7d115305cc621358e51ba13f296e0ffdf4fbd984be9f63bc7862730b/pydantic_core-2.50.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c18db21573bd2c6489f9a544b7499f0df2853958c568e5e783536ee1f690af41", size = 2048429, upload-time = "2026-10-11T18:32:23.3Z" }, + { url = "https://files.pythonhosted.org/packages/c0/7d/fed95d18bf2b5abe2d5ab2bbec4184bfc22b6805994a33ccdae8edffd25a/pydantic_core-2.50.1-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:cb57f304525a5e3c13333b772bf9a473f36326e9c821b2e8e1b2fd36f80ae2c3", size = 2173274, upload-time = "2026-10-11T18:32:24.697Z" }, + { url = "https://files.pythonhosted.org/packages/93/1e/c6f22ceac65dc3d291ff79bea0eb74cbd1de8b128f01fee48af03bcea1e1/pydantic_core-2.50.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a27c09d86600f1bf2fe3f37e1ae697faf3143931c09322cd799da94deee923b5", size = 2360403, upload-time = "2026-10-11T18:32:26.281Z" }, + { url = "https://files.pythonhosted.org/packages/2c/97/190b5b6bfe4c72f265feb657913eb30749193927a5ad7b83cfa7866a25a2/pydantic_core-2.50.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:46b3301d3b5c886f77de7546e47274a5842c622ea2020b8c6524c6b66913b4a6", size = 2439799, upload-time = "2026-10-11T18:32:27.844Z" }, + { url = "https://files.pythonhosted.org/packages/90/24/48cd98388e4ac2c08d0800af36d15413db15e20387f1038123a2c86cb2f6/pydantic_core-2.50.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:93ba4e9d8210d941c200431a56b2c0400b131865947903937ed3ec5404307d2e", size = 2160157, upload-time = "2026-10-11T18:32:29.553Z" }, + { url = "https://files.pythonhosted.org/packages/00/86/d909133d0b9979ed14c20f110f21124a0e346caf071bd66ac5af3009062b/pydantic_core-2.50.1-cp312-cp312-manylinux_2_31_riscv64.whl", hash = "sha256:e5faeaee74a57d32b3ab3aebad2e348f06d3ba946fc5d28c1728455f00a3d13a", size = 2229523, upload-time = "2026-10-11T18:32:31.027Z" }, + { url = "https://files.pythonhosted.org/packages/90/31/4b43f08131b2098e73a852fd932063385f3103b33839fd9d1abdb89e673d/pydantic_core-2.50.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:a3cda0e538208e5d722bbf3698b24f19c0a7d05bc8d5f8a7f9b121ea7fa243d9", size = 2242700, upload-time = "2026-10-11T18:32:32.622Z" }, + { url = "https://files.pythonhosted.org/packages/88/77/de39658569dc7a4c293d110a89629f61145e7538f00d1e4280c28debefd3/pydantic_core-2.50.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:57f51b31ff826e2859120cf4737c5a758a48d96f3e97da40ccee1796d58078ff", size = 2278452, upload-time = "2026-10-11T18:32:34.165Z" }, + { url = "https://files.pythonhosted.org/packages/46/bd/1eeb9e4e791e81210ef9096f58080b32ba15b5b13c108d50aaa3f8ce9f73/pydantic_core-2.50.1-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:8daa7ee75245d43ad7d747e5c9ecc1b1d06552f72b14887e9276f787d57375f4", size = 2450098, upload-time = "2026-10-11T18:32:35.547Z" }, + { url = "https://files.pythonhosted.org/packages/1c/e6/b2accfdff17e5a88d6358536702146de00f9339adaa4d5bbe1ee93cb4832/pydantic_core-2.50.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:acbf31f37c53a5ac0c34706c80b4f5107ba20b05fdd3816124bf236ef0c57dd2", size = 2476839, upload-time = "2026-10-11T18:32:37.119Z" }, + { url = "https://files.pythonhosted.org/packages/3b/7e/c8a83eb5d2cd42c2e13507150fb777b1edea5a018adc9cbf2858a1d08285/pydantic_core-2.50.1-cp312-cp312-win32.whl", hash = "sha256:45b11cac094aa25725581d9304eee93c9028516b9ea80dd9e175e13a5a2c840e", size = 2101425, upload-time = "2026-10-11T18:32:38.593Z" }, + { url = "https://files.pythonhosted.org/packages/c5/17/8bbd530b8659e9d963f5b16f6cb8e159f4cd174b4d6304e48969ab12dba8/pydantic_core-2.50.1-cp312-cp312-win_amd64.whl", hash = "sha256:132529c83901437ff642f585216831bf5fd7a91df66829907e155192ead62498", size = 2172522, upload-time = "2026-10-11T18:32:40.112Z" }, + { url = "https://files.pythonhosted.org/packages/af/9f/a79d690b127e4e3cff143d031538ab9aa715f6b2fbeecbd07cd6f2bf9fb7/pydantic_core-2.50.1-cp312-cp312-win_arm64.whl", hash = "sha256:4e834f6a8e4ff772dcc34f58ef5504147a3ea5b0f4eeb13b0f8eb2ca75ac57f1", size = 2161366, upload-time = "2026-10-11T18:32:41.606Z" }, + { url = "https://files.pythonhosted.org/packages/ae/57/0e237d7091d2cd44a35d243b7344227f90440166860469cd036afc23a04d/pydantic_core-2.50.1-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:d5e062c01286d861fd6a1c4ff6e063547b3e713067f2df033c0ff97ac2ca006b", size = 2222774, upload-time = "2026-10-11T18:32:43.103Z" }, + { url = "https://files.pythonhosted.org/packages/f7/b9/c720e56858d4e1539503297ed37063e0c08e0f3541c41b777f6a800f75fa/pydantic_core-2.50.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:0c003c3b7f49debb893d2d85ae099ac5959c9839e2f330fadb1fcdf7a6594482", size = 2024738, upload-time = "2026-10-11T18:32:44.587Z" }, + { url = "https://files.pythonhosted.org/packages/4d/b8/fbfc25875219cc060e613170ff10e850c6d8924beb4910da57c2ee3ba1d2/pydantic_core-2.50.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:409e0ea40ec30d9158f33574fd758e689f6045a0f2596701828c27816ca9687d", size = 2047049, upload-time = "2026-10-11T18:32:46.164Z" }, + { url = "https://files.pythonhosted.org/packages/d7/43/34210124d504c553688f2f04b48500b131237528ac545b445e0d6d30e0d5/pydantic_core-2.50.1-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:131059670f1d2444269b8585cb888963994871932447c08b39ac6a51fcfef658", size = 2173415, upload-time = "2026-10-11T18:32:47.722Z" }, + { url = "https://files.pythonhosted.org/packages/65/cf/6e178e8fdc11da5965bef980983bf46326a42f436871dd51ba0a57f39df1/pydantic_core-2.50.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6dbcbee53bf17196a7f745aa9bf5a9603953a1e365b1f020be3207c676a3e7c4", size = 2361719, upload-time = "2026-10-11T18:32:49.217Z" }, + { url = "https://files.pythonhosted.org/packages/11/14/bd5169d356aa91bf777e28ba0b281c192d286d03c2812c9c9db023a2f00e/pydantic_core-2.50.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:325c23f3e35cfbf0fe3486fa5f7260d1e45885173002d30a28ca019994124255", size = 2439803, upload-time = "2026-10-11T18:32:51.025Z" }, + { url = "https://files.pythonhosted.org/packages/1c/bc/d79d000e5203ebef39af839f2ce77a777fcad6e08ad26af9a2fcd114ffc8/pydantic_core-2.50.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:17e722e156d0444ecaefbe640bdb60928752bf2013e2b7a11cdb099aaae19bec", size = 2158402, upload-time = "2026-10-11T18:32:52.714Z" }, + { url = "https://files.pythonhosted.org/packages/1b/a5/4902cb5fd599422c130bd3124ab31ee8b771199bd56662702eed07d3fec7/pydantic_core-2.50.1-cp313-cp313-manylinux_2_31_riscv64.whl", hash = "sha256:aa8224f10880d9bf1b5993988ba153d42a8b4f3f4f511f93b1f09c93ff613c72", size = 2229755, upload-time = "2026-10-11T18:32:54.126Z" }, + { url = "https://files.pythonhosted.org/packages/1a/f5/c1481f8669f6060d89110c9b1374173fc8767ca276b84f4870bd8acd5e3f/pydantic_core-2.50.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:41bc8237121bd8dc8d888dfd6279fc166ffc88c1f1bf3a8bf00869680533ca4c", size = 2242303, upload-time = "2026-10-11T18:32:55.641Z" }, + { url = "https://files.pythonhosted.org/packages/04/f9/77fc3c7653ba9b6e42049e17e96b25388187d4a7c274ab1cb07f58ac8419/pydantic_core-2.50.1-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:45c6266d071c241f2a168d45bf8c54344f0effce35e7e6b73afdec11f3687568", size = 2278345, upload-time = "2026-10-11T18:32:57.38Z" }, + { url = "https://files.pythonhosted.org/packages/95/9b/0579c5d12e7f2b16b27e6782427987341fcce07b0725e02ddb0b74add0c4/pydantic_core-2.50.1-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:1deeacb112d14d3f4fcb16b165f7dbaf76c70ba6e82f37ba042bdab51970a0b8", size = 2449947, upload-time = "2026-10-11T18:32:58.896Z" }, + { url = "https://files.pythonhosted.org/packages/a8/ac/1b677db91eba54cc5922f4de6edc46ba45c2bd712dfdc0130382d158e214/pydantic_core-2.50.1-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:1c96fd793b73d1b92e65570132505498fe7b21eaef73cdf74e67e5dfba7ac9e4", size = 2476889, upload-time = "2026-10-11T18:33:00.665Z" }, + { url = "https://files.pythonhosted.org/packages/4d/2a/3a9f6624ee3ea9ccba5249dde11418bb4c35780a7a92608f8768bd3fea39/pydantic_core-2.50.1-cp313-cp313-win32.whl", hash = "sha256:06ead20d39ffd6f2f6f2a8f8a6de67ff8bb1b4f14a8a30e058502514ee2ac685", size = 2101118, upload-time = "2026-10-11T18:33:02.329Z" }, + { url = "https://files.pythonhosted.org/packages/2d/1f/323f78ddd9d9938aac420c1abb4e8ba799fc8bdab0acc67c0593b837c979/pydantic_core-2.50.1-cp313-cp313-win_amd64.whl", hash = "sha256:7816e98acc08119dc0f340ab167048ecc54126316330c1f0caf7c6756c88e28f", size = 2170840, upload-time = "2026-10-11T18:33:03.919Z" }, + { url = "https://files.pythonhosted.org/packages/cb/09/8497c52a739ae425c3ac2f7f56414cbc711c67d374346174f40fe2062644/pydantic_core-2.50.1-cp313-cp313-win_arm64.whl", hash = "sha256:c17799a62c142d61b8a3c51752a7cbc87fe2ad4ccfab10e628a77b405075c662", size = 2161633, upload-time = "2026-10-11T18:33:05.518Z" }, + { url = "https://files.pythonhosted.org/packages/49/33/28b96e81677153715e3eafb9f26663a80841e859fde282a380359b0d3fa1/pydantic_core-2.50.1-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:1cf41f1ae3fa155cf167a72689ad044bcc1e3c97e064123677149bdfb5dafc4a", size = 2224428, upload-time = "2026-10-11T18:33:07.153Z" }, + { url = "https://files.pythonhosted.org/packages/94/40/15c06410c9b7b8da5805d27b64e09bd3f900e986728106db2689dbc51513/pydantic_core-2.50.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:4df197990c15b5a37c5a277d131d9f2c67de6133f2e5dafd80d9bba4b99f46f9", size = 2023740, upload-time = "2026-10-11T18:33:08.763Z" }, + { url = "https://files.pythonhosted.org/packages/a1/4e/5eb629f6efc2a27e421d789dd4bfacbb5f6d09c80c28b13d1e87d73163d5/pydantic_core-2.50.1-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0036473f5583e6a60e50b8b21651511564277a3f05cc5dab8cf579f552cd5f6c", size = 2049435, upload-time = "2026-10-11T18:33:10.366Z" }, + { url = "https://files.pythonhosted.org/packages/ba/8e/f195aebec49ad12318876ac2368c197a7939f5d52f8e156d2238ef8a4588/pydantic_core-2.50.1-cp314-cp314-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:992c3514ec891fa7858099183e4d64e6bd5a5d4ff452fae29df22faa77a006bb", size = 2172975, upload-time = "2026-10-11T18:33:12.368Z" }, + { url = "https://files.pythonhosted.org/packages/e0/f5/7ad9fb83010cd5ea0948409db105676ed779c4e709e2d3d89b9fe2558794/pydantic_core-2.50.1-cp314-cp314-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:739dc730e6be3bd5ec2f4ab5cfc7eb047cc45fc1497b3bafec74ff2ed07df597", size = 2364197, upload-time = "2026-10-11T18:33:14.244Z" }, + { url = "https://files.pythonhosted.org/packages/ca/fb/bf0aab3e78301d202b82a0322ec968cd703b11fc0623fde9a28708936f62/pydantic_core-2.50.1-cp314-cp314-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:32fad3a91e51b6d2039c572db04a5a873260b399f6bd62c3552671fa7a4a2899", size = 2444259, upload-time = "2026-10-11T18:33:15.79Z" }, + { url = "https://files.pythonhosted.org/packages/45/35/38f6d6564fae57d9b12e5676dfa947e0e7d5c46dbeaa7eb3352261d6d299/pydantic_core-2.50.1-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:42b54c2c90ad348b5e3a85e03e715d572c1fde357ef104cdfe3b03b697a404ea", size = 2159857, upload-time = "2026-10-11T18:33:17.51Z" }, + { url = "https://files.pythonhosted.org/packages/65/a0/fb0a3ca10f139dcf765b2d312d10cf0f65c57c59993229d00ad12b14ceff/pydantic_core-2.50.1-cp314-cp314-manylinux_2_31_riscv64.whl", hash = "sha256:2df1ff41884de2bc4b307bafd7c40a691094fad2ff8e767e5b45a319257bcf4e", size = 2233954, upload-time = "2026-10-11T18:33:19.591Z" }, + { url = "https://files.pythonhosted.org/packages/8c/6a/e63842252702aa4ec6e6b7178ca85e541a77459076592c23ebe2d9840b33/pydantic_core-2.50.1-cp314-cp314-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:fe90228920fd8ff2be62622b6bb8a2b11acd65046d50c6b130614b5879605a20", size = 2243876, upload-time = "2026-10-11T18:33:21.393Z" }, + { url = "https://files.pythonhosted.org/packages/39/25/5991cf8318b37e0dfab47b87541619a1df8501a793cba0d978846cba37a7/pydantic_core-2.50.1-cp314-cp314-musllinux_1_1_aarch64.whl", hash = "sha256:844b869f118e22a41a091bdcedda8a71bc1b0f62c38d1a0c3211cece47e1d8fc", size = 2277908, upload-time = "2026-10-11T18:33:23.324Z" }, + { url = "https://files.pythonhosted.org/packages/a7/3e/3ee8baaa6cc25a6961c69168cf9ff0f002d56f4e0d541ad6724c18fb61f3/pydantic_core-2.50.1-cp314-cp314-musllinux_1_1_armv7l.whl", hash = "sha256:2eb75304506894a281d346220a4f7481a1b8729577c5ed2a05395991966a8396", size = 2449285, upload-time = "2026-10-11T18:33:24.942Z" }, + { url = "https://files.pythonhosted.org/packages/c0/c7/acbec6deac13fe697a80c275a9b6661db62c4d323bac8a47347b1f39c7cd/pydantic_core-2.50.1-cp314-cp314-musllinux_1_1_x86_64.whl", hash = "sha256:6b20a4bffabdad0db2927ac034ae3b8a681b1f7a0182f3e60b479ad2fde21ebb", size = 2479013, upload-time = "2026-10-11T18:33:26.925Z" }, + { url = "https://files.pythonhosted.org/packages/10/08/21a3f237b264389f6219d053ee78fc1b5c2fd402c1b1cb2b6cb8b85f9834/pydantic_core-2.50.1-cp314-cp314-pyemscripten_2026_0_wasm32.whl", hash = "sha256:99ba9bc2b8062ea0c326a990f7f00e6530c23579de66dd246e72c4cafef950a5", size = 1484400, upload-time = "2026-10-11T18:33:28.693Z" }, + { url = "https://files.pythonhosted.org/packages/09/ce/077a6d262d12ef09108377ac0717f029f420d773ace63cafd6143af75568/pydantic_core-2.50.1-cp314-cp314-win32.whl", hash = "sha256:cf356f70551d40374eaffb1aa63f1eb6d2006681cbd7a9faea173ce0f4dd7cd2", size = 2103222, upload-time = "2026-10-11T18:33:30.326Z" }, + { url = "https://files.pythonhosted.org/packages/14/4c/350a2415209c43d670eb71d3c040f332c04a30583d39e311b05c7ac15762/pydantic_core-2.50.1-cp314-cp314-win_amd64.whl", hash = "sha256:d32f3acc081cc3923386d88f422cde8892335e95f034e0104bb4cf9310d9915f", size = 2171586, upload-time = "2026-10-11T18:33:32.139Z" }, + { url = "https://files.pythonhosted.org/packages/bf/92/9bea6ca96580a0902fed366f064f0829e404f41889b34543279a1162b888/pydantic_core-2.50.1-cp314-cp314-win_arm64.whl", hash = "sha256:bed5163e03b98bc1fa2eb05d74c63d9c5c95d8ed6254985481640fbf5e237dea", size = 2155773, upload-time = "2026-10-11T18:33:33.896Z" }, + { url = "https://files.pythonhosted.org/packages/86/8c/f121f073cf32bdd5cba7e6230b1ce0ac845b0cf43e44dd597d95af272db2/pydantic_core-2.50.1-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:9572c1369e9c9da2d64a7b7992c786d90ff295abc93964cfe3125e4290768070", size = 2234017, upload-time = "2026-10-11T18:33:35.588Z" }, + { url = "https://files.pythonhosted.org/packages/a4/69/2bb2bcd6146cffe98d760a46c42ae71efd5151d9b2f9c9bf6619a3b32083/pydantic_core-2.50.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:2005207aafe1231315718bf6ed5d064a7300fb4772754af35ee72fc68159492e", size = 2001016, upload-time = "2026-10-11T18:33:37.57Z" }, + { url = "https://files.pythonhosted.org/packages/20/b3/fbf854c7d07ec114260c26e9e2071a4381740f9ae09641dbfcbdf2a18c45/pydantic_core-2.50.1-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:64f6047f62a6c5ae08d0a6afb035667aa2d97c3d20d69762e034c5ea144d92a5", size = 2023015, upload-time = "2026-10-11T18:33:39.433Z" }, + { url = "https://files.pythonhosted.org/packages/65/20/6de55b2f92cdb614b745c6e9ced639fc4fd7e1e77604825a88bdece6fcbd/pydantic_core-2.50.1-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:1ef800dd7d85bcdadf4c3076e4c94e43939493558a3b69a1ea830c706d4617bb", size = 2192543, upload-time = "2026-10-11T18:33:41.381Z" }, + { url = "https://files.pythonhosted.org/packages/0c/d9/19e91c94bd5c405945ce2f15526808aea37e162c253160de8ed7bf70b406/pydantic_core-2.50.1-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b0135bcdcaa0f23573f286e4cb5e0fd2962700964ed13df085b85f2b97aeab9e", size = 2388704, upload-time = "2026-10-11T18:33:43.167Z" }, + { url = "https://files.pythonhosted.org/packages/b6/bc/2e24c8415eae1a25ee5a5484946a917123bad2e9d01689a759236928175a/pydantic_core-2.50.1-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0b3a6f334c6a2345ca15318ff894502a90012536404b37c844a976c76c846e0b", size = 2464118, upload-time = "2026-10-11T18:33:44.856Z" }, + { url = "https://files.pythonhosted.org/packages/bd/1f/945b8053cb061c64e102bcaf7bfb9ed740c0bd4349f9bb978a7d4ddff4ab/pydantic_core-2.50.1-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:06e01fbbfdb9be777b316a71b6c49efaf4a08b615d0a98d678cda3023f79d019", size = 2150142, upload-time = "2026-10-11T18:33:46.661Z" }, + { url = "https://files.pythonhosted.org/packages/2b/78/96a3e50bf0d64aaae781107eb9335b7529d05a85793ed6e7241c4cd1d931/pydantic_core-2.50.1-cp314-cp314t-manylinux_2_31_riscv64.whl", hash = "sha256:a29a061fec0b4e2d714f277e70a3a18125ecff803f2fea6eade2f2e53711d112", size = 2245577, upload-time = "2026-10-11T18:33:48.574Z" }, + { url = "https://files.pythonhosted.org/packages/7a/5d/a6038a0322232758a6ebfa709f4ca14a60bf5b93940cd0b345056a557da4/pydantic_core-2.50.1-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f5187624823423e1d1b82b1072ac41dc837389e18d3d0572cc19bbee46cd550a", size = 2263728, upload-time = "2026-10-11T18:33:50.527Z" }, + { url = "https://files.pythonhosted.org/packages/0d/4b/76ded3333a457a9344c4f2d63f2d82d0101654b05178fa4ddfe7d3627674/pydantic_core-2.50.1-cp314-cp314t-musllinux_1_1_aarch64.whl", hash = "sha256:3e46a9eb0a0901dd6275e6b06ac3a464885ef350ec4121fe486869de8053e4bb", size = 2293630, upload-time = "2026-10-11T18:33:52.362Z" }, + { url = "https://files.pythonhosted.org/packages/a9/00/9eca378335c9c1b72bc779bf6e4c2a82ce784f14ec48a0e87102c9870e05/pydantic_core-2.50.1-cp314-cp314t-musllinux_1_1_armv7l.whl", hash = "sha256:756d669f04e62ec4148ecfe22be6a4484d9b1181a6ef32e205ebfd200540858b", size = 2468048, upload-time = "2026-10-11T18:33:54.118Z" }, + { url = "https://files.pythonhosted.org/packages/35/ca/e3832e9cf93651251de43c8c5c029ed680a3c1a0a1b17ee26c81bed08cbd/pydantic_core-2.50.1-cp314-cp314t-musllinux_1_1_x86_64.whl", hash = "sha256:c516cc5367ca3448995d42cb994bf3f4c9002d2a7c22eac9622551269ad1b807", size = 2512159, upload-time = "2026-10-11T18:33:55.99Z" }, + { url = "https://files.pythonhosted.org/packages/4b/f2/773469b5a10a39116a2cb17edaf6d722f017dd8da07161b371465311c542/pydantic_core-2.50.1-cp314-cp314t-win32.whl", hash = "sha256:9d1bed94af6a63835461f3cf7502058eb166c58c4778e11d0f433cfb1bd69e19", size = 2098406, upload-time = "2026-10-11T18:33:58.043Z" }, + { url = "https://files.pythonhosted.org/packages/ee/42/0bb74f8f25204b259b11ab7c12dc7f180893b6bd706118b385147fb6efd5/pydantic_core-2.50.1-cp314-cp314t-win_amd64.whl", hash = "sha256:c8dce1f1e0e5358b682a6ad3fa5e31b31d4560997b8e61417e9217c8d60f8a0c", size = 2148481, upload-time = "2026-10-11T18:33:59.913Z" }, + { url = "https://files.pythonhosted.org/packages/47/0d/d801646c9679a4e630e15cf521d4108b93854b42a6e6e02391bd4c6b1095/pydantic_core-2.50.1-cp314-cp314t-win_arm64.whl", hash = "sha256:ceff0acc940be2715bd6ad17b24c0e5304abf44f6efd0f81ee8499e640f9dc86", size = 2174972, upload-time = "2026-10-11T18:34:01.875Z" }, + { url = "https://files.pythonhosted.org/packages/b2/84/23984b763d8862a02a13d27a44b6e8169428fd85ecfed88f54c29108604d/pydantic_core-2.50.1-cp315-cp315-macosx_10_12_x86_64.whl", hash = "sha256:8a6791afa2245e6c6b180122d105941644f5bd410bb18623b408808cc41a3102", size = 2224599, upload-time = "2026-10-11T18:34:04.016Z" }, + { url = "https://files.pythonhosted.org/packages/4d/90/a63cf8586abc1d1a3f6d9b18f0224789ebf003851f092ebda3c7c863fd32/pydantic_core-2.50.1-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:84f34323a61a365b4e9295de6028474754829aaddd59c7bf1a040e7487ef8f3c", size = 2024191, upload-time = "2026-10-11T18:34:05.901Z" }, + { url = "https://files.pythonhosted.org/packages/a6/6a/f34bff9808ffb4907fbf5f5040457d253cacf2da7fce9efbc99ca1b1a44d/pydantic_core-2.50.1-cp315-cp315-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:23edad659e8dbd8ca7e4e877fe6c81573abbdf215bd25a68b53e1272f58b80c7", size = 2048252, upload-time = "2026-10-11T18:34:07.757Z" }, + { url = "https://files.pythonhosted.org/packages/b2/54/13f419bf1eb59852003818e25935aaf175687d978f4c4bca70e08fe40a3b/pydantic_core-2.50.1-cp315-cp315-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:3a5fce22f1e87d181e924e12da7d81cfe031fb3881a5ddf26ad28f141756ca43", size = 2173376, upload-time = "2026-10-11T18:34:09.592Z" }, + { url = "https://files.pythonhosted.org/packages/6d/6c/b5a34d24cd0c81669d8f8339d74e6815abcf2f8fb48ab4b49b84c09be1d5/pydantic_core-2.50.1-cp315-cp315-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c73622ef819328873b53109ee4f77ceb598bffedd02daf916102be3228866b78", size = 2364559, upload-time = "2026-10-11T18:34:11.534Z" }, + { url = "https://files.pythonhosted.org/packages/eb/8d/d64d6216a8df365082665927ff923f183056f9049fee08e9777c9ac05296/pydantic_core-2.50.1-cp315-cp315-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ce8c25ca38cc0e3d7753ba180808de2c0c8cb24eae0df64491e40921454e9831", size = 2444697, upload-time = "2026-10-11T18:34:13.535Z" }, + { url = "https://files.pythonhosted.org/packages/b8/0d/1b1149f60a00ea21ba5f70e28acbd40feb4598af414f80f53c921fac07c9/pydantic_core-2.50.1-cp315-cp315-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7689580e72a642ab5ec64d5f55b2e33636fa43b4ebe63c0c2c965ef307c7d1aa", size = 2159961, upload-time = "2026-10-11T18:34:15.56Z" }, + { url = "https://files.pythonhosted.org/packages/1e/35/f236549299dcc78e71e945495d7ec67e78d20844d0999c60601685003031/pydantic_core-2.50.1-cp315-cp315-manylinux_2_31_riscv64.whl", hash = "sha256:d5c0e32fdbce7f1e8ef4d11f655694bf5f4175c757a9f1dc2be09b8864e5bcf5", size = 2234581, upload-time = "2026-10-11T18:34:17.502Z" }, + { url = "https://files.pythonhosted.org/packages/6a/85/26901a490522b7f75ef9bb9a7afb73e5bb550f0e1cb5b99a0069183e2eb9/pydantic_core-2.50.1-cp315-cp315-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:40f523349960fa30f3ea51404308ff50f9997a90df639590f47a057c1f32b415", size = 2244090, upload-time = "2026-10-11T18:34:19.402Z" }, + { url = "https://files.pythonhosted.org/packages/ca/2c/481bcfc70ceeb77a778ca6e5b705fe592cb64735c108157f81b7dd9c280e/pydantic_core-2.50.1-cp315-cp315-musllinux_1_1_aarch64.whl", hash = "sha256:d4193206b6587047437f6f11d7e776df23e1c1e23af2a54d9347275614791e10", size = 2277948, upload-time = "2026-10-11T18:34:21.317Z" }, + { url = "https://files.pythonhosted.org/packages/24/eb/f1e09333faa7ba447cde967310f758430cc7c5e987bdab5228816c70030d/pydantic_core-2.50.1-cp315-cp315-musllinux_1_1_armv7l.whl", hash = "sha256:84bc765b282a9d5b7fe0348b8648904f25a6a04b2139da52b1dd30c8ac3a2c8f", size = 2449688, upload-time = "2026-10-11T18:34:23.321Z" }, + { url = "https://files.pythonhosted.org/packages/d1/b3/036bde636db8f76d92996e81aefc75678ab5cec4a07eea1ad0c72a893fc3/pydantic_core-2.50.1-cp315-cp315-musllinux_1_1_x86_64.whl", hash = "sha256:ed1e728b39a383c81035b2459cfcb35d99dfb01f7d6ebe3a913bc1cc5b81e459", size = 2479286, upload-time = "2026-10-11T18:34:25.214Z" }, + { url = "https://files.pythonhosted.org/packages/d0/a3/07f018294ee18d144afeb6df1a47d9e92960f014be45c5ed13519fa5af95/pydantic_core-2.50.1-cp315-cp315-win32.whl", hash = "sha256:bc94f474417604bd383d2cd445d071b07dd55fedceed3ce33407bf1fcc107290", size = 2103683, upload-time = "2026-10-11T18:34:27.42Z" }, + { url = "https://files.pythonhosted.org/packages/5f/98/f9bd7e1f9b6709f155acb9ef826d9c3884fe925f811fd8e55b9b52280bad/pydantic_core-2.50.1-cp315-cp315-win_amd64.whl", hash = "sha256:983a662de2571cb2502fc8ff47b6770b03d025d2eb314c92f77b3f07c74720ed", size = 2171681, upload-time = "2026-10-11T18:34:29.508Z" }, + { url = "https://files.pythonhosted.org/packages/10/87/4bb3e1e7f385c076ab5af4d6dd0571b22042cd8207eb810d5b9fef15ae31/pydantic_core-2.50.1-cp315-cp315-win_arm64.whl", hash = "sha256:94845ff54dc5193f228cab81b2662a04bfbb892e95bdc15edf7399000ce57d54", size = 2156251, upload-time = "2026-10-11T18:34:31.455Z" }, + { url = "https://files.pythonhosted.org/packages/47/47/83643225b08f2aef6c8cc4bbe6e3f79c5e139c4364a6e450d0f399d87774/pydantic_core-2.50.1-cp315-cp315t-macosx_10_12_x86_64.whl", hash = "sha256:4a53d13cdfbedbfa87f08b83c1a0a5efcc767d785a4b41934fa9cb672670493a", size = 2234363, upload-time = "2026-10-11T18:34:33.65Z" }, + { url = "https://files.pythonhosted.org/packages/5e/66/127ca649ba2f2462039dc1e694c6c01e00a3689f023a617364d3507e6d97/pydantic_core-2.50.1-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:efbecf43d321f7b9281441f1f213f7c21c66988b0e06c2730ba13ed47a46bb08", size = 2000972, upload-time = "2026-10-11T18:34:36.037Z" }, + { url = "https://files.pythonhosted.org/packages/5e/4f/e421e0a5d653b1203b090b2e48745976988d7338a647940704b5b9c2b399/pydantic_core-2.50.1-cp315-cp315t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bc1f08f68dac9f9e83845a8039880aba2ab553eb9b2259c3243a313182c253fe", size = 2022925, upload-time = "2026-10-11T18:34:37.972Z" }, + { url = "https://files.pythonhosted.org/packages/d5/4e/ea5568e2491e1a71100f15ae8c2d01ef52db42a184a2d4e716bc79e5eb8f/pydantic_core-2.50.1-cp315-cp315t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5dfe41f232befddb9c4377f6cfc702b51595e2d78ed082672adf8758d2c4619f", size = 2192867, upload-time = "2026-10-11T18:34:39.921Z" }, + { url = "https://files.pythonhosted.org/packages/ae/5e/3b8c3a35acbe219909ada5defad5d7d9fed845fb2b37bd5ec518f453c119/pydantic_core-2.50.1-cp315-cp315t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:adc06d218a1cadfd2ec4628424d7d79ce4eba69c2965e7e7b55106f0da5208c8", size = 2388687, upload-time = "2026-10-11T18:34:42.184Z" }, + { url = "https://files.pythonhosted.org/packages/b6/aa/7889b4e515f91a2e8c0ae6b5081fec0feb30c4398d1434e14793c60f173a/pydantic_core-2.50.1-cp315-cp315t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2cf91809d0721ab81592ba67bea7694821679c10b1a2e3c3460082b286c1918a", size = 2464415, upload-time = "2026-10-11T18:34:44.384Z" }, + { url = "https://files.pythonhosted.org/packages/08/78/93449e628eb8a6fdcce3eff9043081179d1bc7ce6f1bff32dc5006f41e00/pydantic_core-2.50.1-cp315-cp315t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:23923ab9292c40da026330b1ecf4dc2618c8e86e0422e5d1fbf50d94d64ca4f8", size = 2150823, upload-time = "2026-10-11T18:34:46.392Z" }, + { url = "https://files.pythonhosted.org/packages/f4/f1/72c5bc129fceb0d00f05dc1e67f518c1728de1928c55f81fc13d7690de39/pydantic_core-2.50.1-cp315-cp315t-manylinux_2_31_riscv64.whl", hash = "sha256:f3377c8c2b3ce898423c5e5dd94c7982e30aa7717a7e6ab2470b9de364963709", size = 2245806, upload-time = "2026-10-11T18:34:48.805Z" }, + { url = "https://files.pythonhosted.org/packages/28/2a/922a0e78f3aa6ab837b59f88190233fb8dad546c17995fde9bb3ed3b9b49/pydantic_core-2.50.1-cp315-cp315t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:455a773617b5913bf5c20d0692e5787b119e52c4d40ea644ca31f5758fd31be2", size = 2264160, upload-time = "2026-10-11T18:34:50.876Z" }, + { url = "https://files.pythonhosted.org/packages/52/a8/0f1449e3e1b20941c9372faa18e7b6a092e30cdfa841902473f7989532ac/pydantic_core-2.50.1-cp315-cp315t-musllinux_1_1_aarch64.whl", hash = "sha256:1a9006395dece0e32e704c315eff8a00bede494f6108546cfc5539c89fef4f9a", size = 2294031, upload-time = "2026-10-11T18:34:52.876Z" }, + { url = "https://files.pythonhosted.org/packages/d1/d0/1031f492857de70355fb16524bbb03efce5fd34c93ed4a1ec60be07e0d4b/pydantic_core-2.50.1-cp315-cp315t-musllinux_1_1_armv7l.whl", hash = "sha256:d2d82aa62521c55ddfb000ae70f88cdd8de974078f6024e821dfe5addd0c818f", size = 2468423, upload-time = "2026-10-11T18:34:54.995Z" }, + { url = "https://files.pythonhosted.org/packages/46/52/269ffffa645b8e47906395a39cf9db1151ae9fa4bcd7f47b960bc31baf37/pydantic_core-2.50.1-cp315-cp315t-musllinux_1_1_x86_64.whl", hash = "sha256:009634b83993777ddcd69cad0ffcace43dabde692109528e35f0fde91e386a8b", size = 2512598, upload-time = "2026-10-11T18:34:57.149Z" }, + { url = "https://files.pythonhosted.org/packages/31/5c/e47e28281f20326ff6f3c31d626f0a83e615d2d94ba41bb0ad6ec237184a/pydantic_core-2.50.1-cp315-cp315t-win32.whl", hash = "sha256:3fde4fdc6487a58d944ca87cf5adc95d5f266e872c19599f5f4c0a8a1b1f9f9f", size = 2098535, upload-time = "2026-10-11T18:34:59.313Z" }, + { url = "https://files.pythonhosted.org/packages/03/ad/759e181e69c1b472c60b2049e5f61d5da1deefdd5ce1df4bb2ebcf771f25/pydantic_core-2.50.1-cp315-cp315t-win_amd64.whl", hash = "sha256:1c8632d4ac04e6f91128fca584b3a8a507d81604c24eeaaad00d4be42765c32b", size = 2148645, upload-time = "2026-10-11T18:35:01.571Z" }, + { url = "https://files.pythonhosted.org/packages/6d/56/8a702c27e5be9f47e5f19d8669227424290e4c024e7c370279cbaf244b4e/pydantic_core-2.50.1-cp315-cp315t-win_arm64.whl", hash = "sha256:c3ede305158e75510be50869b319550ab072008c13d64d4ab1e094fb286b6f44", size = 2175297, upload-time = "2026-10-11T18:35:04.079Z" }, + { url = "https://files.pythonhosted.org/packages/e7/73/a23a327237d9bb985298ce47702e196f995ce850224c12c70886bd66bb5c/pydantic_core-2.50.1-graalpy311-graalpy242_311_native-macosx_10_12_x86_64.whl", hash = "sha256:062e891facce5ca296a1c37098e5e466780457f86413894b399f0cf22934f769", size = 2162560, upload-time = "2026-10-11T18:35:06.274Z" }, + { url = "https://files.pythonhosted.org/packages/df/b2/33b37b5e82408f402a5e82649a43e7c95cd5dab7beaeef2c35cedbfd18f2/pydantic_core-2.50.1-graalpy311-graalpy242_311_native-macosx_11_0_arm64.whl", hash = "sha256:49c2cbb2397fe4d0987e84606e691af6cb87bc0ee1bd3e7b737f7e10b4c142f9", size = 2075250, upload-time = "2026-10-11T18:35:08.455Z" }, + { url = "https://files.pythonhosted.org/packages/04/62/c7d5b9249466ccab90f3ce4790c2399dbfb8172ae9e74a7753dd295fe65a/pydantic_core-2.50.1-graalpy311-graalpy242_311_native-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9e4472072de0137ee0d8e72d6620e85939c271d2f90f6bbb4b15c24638b79f92", size = 2107891, upload-time = "2026-10-11T18:35:10.918Z" }, + { url = "https://files.pythonhosted.org/packages/d4/7e/28d29bc1657195933147f772dee0558d9e0f045bbc11db7f992f40c37bb5/pydantic_core-2.50.1-graalpy311-graalpy242_311_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6ed4f3cef55164b026fefb41341b7754cc6b624c75dfe7142d2ecceb5ad21c87", size = 2268026, upload-time = "2026-10-11T18:35:13.336Z" }, + { url = "https://files.pythonhosted.org/packages/a5/09/1bcf160f3cd6333e2a76982fae5963e5032de0bcaaba38464223dc266bfe/pydantic_core-2.50.1-graalpy312-graalpy250_312_native-macosx_10_12_x86_64.whl", hash = "sha256:76e2e83fa6ec8cdc972d438dafc2522b3a47bee4ec0ae668b29cfb1977ab5242", size = 2217070, upload-time = "2026-10-11T18:35:15.688Z" }, + { url = "https://files.pythonhosted.org/packages/3d/81/f02de95eec7794dfc7a5bc69a834f0e834b31b3009014ce6de903855f775/pydantic_core-2.50.1-graalpy312-graalpy250_312_native-macosx_11_0_arm64.whl", hash = "sha256:a51eee75939cf811ac09b278745a6cee7dc873ccfbc8b9af3cc88fe4b7ce25b5", size = 2039027, upload-time = "2026-10-11T18:35:18.07Z" }, + { url = "https://files.pythonhosted.org/packages/4d/16/227746ed3771d9bf2304568b55134849ece34e13b38b1d76de763015c77f/pydantic_core-2.50.1-graalpy312-graalpy250_312_native-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ae28183297fb0d2b8dc46a1f01d51f5e45825fc5afe76a835a6cb7fb34821295", size = 2109009, upload-time = "2026-10-11T18:35:20.218Z" }, + { url = "https://files.pythonhosted.org/packages/e5/b9/7664d1592a0e5a74903f357cd5b28ceb7336f3473256c5a4e8c8432f1881/pydantic_core-2.50.1-graalpy312-graalpy250_312_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:88e492e8b9d0312e7dc13667c30222abf284dc3b79b5302b3607b41a5784ce61", size = 2269883, upload-time = "2026-10-11T18:35:22.48Z" }, + { url = "https://files.pythonhosted.org/packages/bd/35/002a378302ff91d2a7f149bc8d22363faf581ba40ac39d0123444315a32d/pydantic_core-2.50.1-pp311-pypy311_pp73-macosx_10_12_x86_64.whl", hash = "sha256:7456d699b13954e9c0164dcb267250a10ae0dfb03e6e26d6796ab0d46e189c84", size = 2154076, upload-time = "2026-10-11T18:35:24.743Z" }, + { url = "https://files.pythonhosted.org/packages/4b/5c/7a034330082c00f3c9795052bd9b161aaaf6e1951e897ac00a094823ef7e/pydantic_core-2.50.1-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:b0d955195bbbe489ad343fcc956eacea9357b79cb22192c66cacdefcbc14b32f", size = 2085850, upload-time = "2026-10-11T18:35:27.009Z" }, + { url = "https://files.pythonhosted.org/packages/57/fa/d5b44a7d3d4eceed6ef8713a0003af56fefde6ec75915513bcdd5d730cd9/pydantic_core-2.50.1-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f2c634642694e6a0dad2ab1d375589fa671fd442edd5caf7d9737b8f6ca22906", size = 2259754, upload-time = "2026-10-11T18:35:29.763Z" }, + { url = "https://files.pythonhosted.org/packages/b6/88/e01dd37301710bd8b3b2daf34ec9e2a6e83a333130831c0d468b0292a48c/pydantic_core-2.50.1-pp311-pypy311_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ee6db2fbed51a7991302e8fac498cd67e336246026d0dfa84cf5166ce1412760", size = 2268712, upload-time = "2026-10-11T18:35:32.654Z" }, + { url = "https://files.pythonhosted.org/packages/3e/43/5bb80d4a4d2b2d84612a30205662cc521a20d209c94abc079ea48b4e0df2/pydantic_core-2.50.1-pp311-pypy311_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:79490e33c4c0fcb933bbbcfc3a62184d8803b99f535863dfbb925e1bcb6945ad", size = 2305049, upload-time = "2026-10-11T18:35:35.392Z" }, + { url = "https://files.pythonhosted.org/packages/e8/7b/e3ef76b269cfe4a5bd3bdcf5d7124cf05e5a8909d443b91639307116bdae/pydantic_core-2.50.1-pp311-pypy311_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:48569b0ade9edfbe065cad1d700175546592aebbb42f02adcebcc26e75b896fe", size = 2466001, upload-time = "2026-10-11T18:35:37.791Z" }, + { url = "https://files.pythonhosted.org/packages/8f/7a/ea0947aadc1d9f72d4be00d2e19939611ec17363bcb5e6eb9ec7d8221c34/pydantic_core-2.50.1-pp311-pypy311_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:5f3cae32fc46121f787cb2486de9cf95a8bf72aec5cc78f64c606fa1735a6ef5", size = 2481777, upload-time = "2026-10-11T18:35:40.287Z" }, + { url = "https://files.pythonhosted.org/packages/24/f3/d15bc0b1fb0c4f1e07b3326ffb7489f7ae70da2b56a0884d22641b0eb47c/pydantic_core-2.50.1-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:7f476456ac2bb0d937f75191494a09c83a30765fea4f70f3b404942fe25f6cdf", size = 2336787, upload-time = "2026-10-11T18:35:42.558Z" }, +] + +[[package]] +name = "pygments" +version = "2.21.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/49/2e/ced460408999b33da6b31b0021b0f37d329e202d4169aeb164493778f25b/pygments-2.21.0.tar.gz", hash = "sha256:610ca751c9bc2492b38eb9a38a7fbc93edbbb2d7182edaf34e66ae493dee5c8c", size = 5005329, upload-time = "2026-08-17T08:02:48.824Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/71/46/17f022dd3e953bf20a04a028a21ec746d942f8d2af30fa0f124fa0e6a684/pygments-2.21.0-py3-none-any.whl", hash = "sha256:2363c69b61c4a97c838da3b130dcd6468f4848992b21a82f2a63ec34377137d9", size = 1250147, upload-time = "2026-08-17T08:02:44.912Z" }, +] + +[[package]] +name = "pyright" +version = "1.1.414" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "nodeenv" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/e1/1b/244c7b710031ada80f27e579ec20d28a2285dfc318fed0339866b1047f12/pyright-1.1.414.tar.gz", hash = "sha256:523c0a97c60da6333234955c277730c9cf4f5bd6d5399e7b7d2b0fc5d3599524", size = 4154638, upload-time = "2026-09-10T12:26:53.181Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d7/ba/18b6e682ead424ad24bcc134339ae5d1b931cd9ae260540592a058a91279/pyright-1.1.414-py3-none-any.whl", hash = "sha256:2a6b4b3298c9eec174c5ed83bd338de6eee82df2992f3e1930e6199d381be36f", size = 6225049, upload-time = "2026-09-10T12:26:51.427Z" }, +] + +[[package]] +name = "pytest" +version = "9.1.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "exceptiongroup", marker = "python_full_version < '3.11'" }, + { name = "iniconfig" }, + { name = "packaging" }, + { name = "pluggy" }, + { name = "pygments" }, + { name = "tomli", marker = "python_full_version < '3.11'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/e4/47/b9efed96c114afcfa3c9d3fe98a76a1d14c74a9e266d397cf6eb64be5e01/pytest-9.1.1.tar.gz", hash = "sha256:1088fbde8f2b49d95a549a195707afa7a76a3ce9bcadc26b6d71f0ffda5fe313", size = 1636369, upload-time = "2026-06-19T10:58:32.857Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/24/25/1de2678b631f5a49215c6c96fff41ba892b0a34df68d6d80292b1b48aa7f/pytest-9.1.1-py3-none-any.whl", hash = "sha256:37a86b45efb9a47a61a36449063e8e18d0cab3161329fc099eb21783169c4f0c", size = 386536, upload-time = "2026-06-19T10:58:31.347Z" }, +] + [[package]] name = "python-dotenv" version = "1.2.4" @@ -124,40 +384,119 @@ wheels = [ ] [[package]] -name = "requests" -version = "2.34.2" +name = "ruff" +version = "0.17.2" source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "certifi" }, - { name = "charset-normalizer" }, - { name = "idna" }, - { name = "urllib3" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/ac/c3/e2a2b89f2d3e2179abd6d00ebd70bff6273f37fb3e0cc209f48b39d00cbf/requests-2.34.2.tar.gz", hash = "sha256:f288924cae4e29463698d6d60bc6a4da69c89185ad1e0bcc4104f584e960b9ed", size = 142856, upload-time = "2026-05-14T19:25:27.735Z" } +sdist = { url = "https://files.pythonhosted.org/packages/ae/58/690cf56da80c8f2c8bf12042b6017beac2c34fe961f65420bcb3fb7fac38/ruff-0.17.2.tar.gz", hash = "sha256:84d632402d14c23b488f941db23712d6736a013225162062d34558c3f3c780eb", size = 5333400, upload-time = "2026-10-22T18:38:00.181Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/a0/f4/c67b0b3f1b9245e8d266f0f112c500d50e5b4e83cb6f3b71b6528104182a/requests-2.34.2-py3-none-any.whl", hash = "sha256:2a0d60c172f83ac6ab31e4554906c0f3b3588d37b5cb939b1c061f4907e278e0", size = 73075, upload-time = "2026-05-14T19:25:26.443Z" }, + { url = "https://files.pythonhosted.org/packages/98/b8/8b6d69c57e8fe1cc6af1aa7493b72a1a5b5a8afe34694e302025441729d4/ruff-0.17.2-py3-none-linux_armv6l.whl", hash = "sha256:96a65e755d8dba094707fb23ab602111d9a31ec2835b3a6992a1914a8fcb211e", size = 10183857, upload-time = "2026-10-22T18:37:14.956Z" }, + { url = "https://files.pythonhosted.org/packages/e8/61/12cc2ff7b2fa90a268ce1e2162c23aaf76e601d22623f6a31b0eeaa764b0/ruff-0.17.2-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:39c5b55c960515cdb32be16e69efb5734c589c06a0eb38a22694524a336b889d", size = 10210904, upload-time = "2026-10-22T18:37:17.985Z" }, + { url = "https://files.pythonhosted.org/packages/e8/7c/b8850a8e4ad29f64a827dd6c6902db4a9aa538fb2b9eef4e26084001a3bb/ruff-0.17.2-py3-none-macosx_11_0_arm64.whl", hash = "sha256:92a80d2f44584dabb0189b3a6c393e37e525e04942838482010575cb81945be7", size = 9408439, upload-time = "2026-10-22T18:37:20.964Z" }, + { url = "https://files.pythonhosted.org/packages/b7/b6/6a64fae86ca5e5e29d5adc311e5481de726cedf9aee607435a16c31c442a/ruff-0.17.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b7d0906677d89bbf3cf73cde64b5bbe2ab35df3ae43e49ee2627301e91265bac", size = 10047078, upload-time = "2026-10-22T18:37:23.717Z" }, + { url = "https://files.pythonhosted.org/packages/10/19/23d376547715175aa1bd46df48df6aacc7c6439d9daf19cac15975180aa5/ruff-0.17.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:7cfd783590edf2b77317882631900f6a13ea2e8eacefe6ebf2370d2715299160", size = 9990478, upload-time = "2026-10-22T18:37:26.584Z" }, + { url = "https://files.pythonhosted.org/packages/93/6c/34cda32cbe13adac5c6b291a307a5570d8ebd37c0c86339f0fe628e55632/ruff-0.17.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:122258f6ecde0e0dd1bb60b24263c3edde4338caf723fca711cc729f9bfd414a", size = 10673624, upload-time = "2026-10-22T18:37:29.767Z" }, + { url = "https://files.pythonhosted.org/packages/bf/10/5d762a4dbc851d8bb47863cf3a28a61bf31c804d393b70d891fac899f5d1/ruff-0.17.2-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7f8fba429d6ac4128ab29cfb8fa6240d2fa671d04adf7f84d3b22fc7b6b6bea4", size = 11351797, upload-time = "2026-10-22T18:37:32.535Z" }, + { url = "https://files.pythonhosted.org/packages/3f/04/a0e92a81faf5c81c1c98d4374c8401734ccf2b8cca7d0170cb0fec08c6e2/ruff-0.17.2-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:583bd67bb9e7061dd09bc46a0a884bae2bbd214dbcd48e509813612619683869", size = 10949414, upload-time = "2026-10-22T18:37:35.501Z" }, + { url = "https://files.pythonhosted.org/packages/c3/d8/59894cf630d2d86882457a2a6a0a1533410c5c805bfbac6f6eb4b5aef69d/ruff-0.17.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c60f93fec7142dba5b8f487f94bf2f6231dae24dc11e4c48648347c8b0720004", size = 10528000, upload-time = "2026-10-22T18:37:37.88Z" }, + { url = "https://files.pythonhosted.org/packages/ab/95/d6e30c51e851d37e10762ad91fa1e76ddaad998589b5667962a3cfbc9edd/ruff-0.17.2-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:c555a877f8f41447e318101cfefea9bf12dfa9f82eedf90c376e57e069f917d0", size = 10571779, upload-time = "2026-10-22T18:37:40.444Z" }, + { url = "https://files.pythonhosted.org/packages/f4/5a/a7e1d74fb464250137d3d4eca645d323536533b672004d04ee0e46e0caf3/ruff-0.17.2-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:ba405cbd5ec7bda1f555d5e52be1fd68d02608d4d95d24591bdac92cfacb579f", size = 10051707, upload-time = "2026-10-22T18:37:42.812Z" }, + { url = "https://files.pythonhosted.org/packages/6e/f2/02fca29ca7999380f0350a7212fe755c11ab9c22d61327356cce8decdbc6/ruff-0.17.2-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:8c21b4ab24485358f17291a4f8dc5399b834e963b8efedd920fe4fdb02081bb4", size = 9998227, upload-time = "2026-10-22T18:37:45.224Z" }, + { url = "https://files.pythonhosted.org/packages/d1/00/55aa604a093dfdc1526e570fae0bb7d37a2221c7b4728d5f080b2add16ba/ruff-0.17.2-py3-none-musllinux_1_2_i686.whl", hash = "sha256:5875a16b0de70b43cb81eabea5ae5e8f5d1b2fd1b5e6ed07f80cfe5019d0bd5a", size = 10377692, upload-time = "2026-10-22T18:37:47.704Z" }, + { url = "https://files.pythonhosted.org/packages/e4/5a/a7a640f47bb906ec8fa233ea84319d503e6dee02b59e3901bd312ebd1f9b/ruff-0.17.2-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:2d086be452eed686aa51271ecf2cbe5037956517cc6ee39a17b4489ac12f8bbe", size = 10790587, upload-time = "2026-10-22T18:37:50.191Z" }, + { url = "https://files.pythonhosted.org/packages/2c/d4/c3b74e1b4808438ea7f14bb914478025e2d51261f60774a54a0fa222ec46/ruff-0.17.2-py3-none-win32.whl", hash = "sha256:6bce7d1f5165701ae18f5df85c65afe78cddfa6c5fb4b9bdb0014d60388f3edd", size = 9870537, upload-time = "2026-10-22T18:37:52.486Z" }, + { url = "https://files.pythonhosted.org/packages/1c/9a/c7da96c2c96d20704cf9027f7a5121da272a8c05f1d1531ba949e3b3df04/ruff-0.17.2-py3-none-win_amd64.whl", hash = "sha256:1b59d447f197bef9ef48a22ba1a6016137753c6099e9bac9c36eb566e422424c", size = 10282826, upload-time = "2026-10-22T18:37:55.2Z" }, + { url = "https://files.pythonhosted.org/packages/81/60/a3604c79cb02777b6cb84da894104021986f06c4bc41375102cc95049a32/ruff-0.17.2-py3-none-win_arm64.whl", hash = "sha256:195ad918027f817c119310ca89a42d347887dfc28934aaa869325e9c5dc9d962", size = 9827036, upload-time = "2026-10-22T18:37:58.031Z" }, ] [[package]] -name = "system-one-extract" -version = "0.1.0" -source = { virtual = "." } -dependencies = [ - { name = "python-dotenv" }, - { name = "requests" }, +name = "tomli" +version = "2.5.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/b0/78/9ad63712633ed3ab5cc1a648d863d7e7da371e9425e209555a0fe711b695/tomli-2.5.0.tar.gz", hash = "sha256:264507556cd8b8c8e7c6ee037cdf443a463f03f4c958e57195e3d369711b8ff6", size = 17662, upload-time = "2026-10-07T12:23:37.892Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/22/a6/ab99b60ee52acd949684febabc3005d0045d0f66bebd9cdebd67372d26dd/tomli-2.5.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c4dc1c1781f2f716de763d1e9a7b34c6a894e167e291c7c5d16c72f7a9538545", size = 163901, upload-time = "2026-10-07T12:22:15.601Z" }, + { url = "https://files.pythonhosted.org/packages/bc/00/ee01b7ed4579180fff07142d290257f25ba786f23f3ec6005f620933c2f5/tomli-2.5.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:eff8babca5a7999bc137acbc7482a8b7e17ffca5075ab41f5d770ab408c7bfef", size = 163756, upload-time = "2026-10-07T12:22:16.957Z" }, + { url = "https://files.pythonhosted.org/packages/72/c2/4efebf65372f6583185f79799312109dddb61102d47e5c33dcfd1a297aca/tomli-2.5.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:86665cee9c4835b7a7f1e8ec2c719b5258d4dc782887aded5a8ae7352a96843b", size = 268038, upload-time = "2026-10-07T12:22:18.135Z" }, + { url = "https://files.pythonhosted.org/packages/53/07/5850468e925d898abb36038666f9c333a94d2a223e802a8ba5b6d319d23f/tomli-2.5.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d7e369fd63331746182360977b1892bfc215476a30d61612d732425311639f56", size = 276422, upload-time = "2026-10-07T12:22:19.567Z" }, + { url = "https://files.pythonhosted.org/packages/b4/87/f293984cdcf83c054196d4fd3dad44fc68ae55b4b8c44bc76cef360c3150/tomli-2.5.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:7ad1ea345759240d6463efa0ed1c704402752e49aa21476620738d74d72d8aa1", size = 272616, upload-time = "2026-10-07T12:22:20.794Z" }, + { url = "https://files.pythonhosted.org/packages/ce/ce/db582886b3c1219d3fec93ebd669332482e5aee7a91e0f7838d84f2d1759/tomli-2.5.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:96243987194634bd411066ce40c952e108f86af04db533ecd8ac3ff2a85b1885", size = 276593, upload-time = "2026-10-07T12:22:22.12Z" }, + { url = "https://files.pythonhosted.org/packages/bf/72/7619b87dea4261fc27dd7b54c4461c129c1f7d9bb7ba3aec89c797a431b8/tomli-2.5.0-cp311-cp311-win32.whl", hash = "sha256:610b27d99f28ec5f191c7064a48f3ddb179a1fe6ca73d571483ae859f57b605e", size = 101830, upload-time = "2026-10-07T12:22:23.651Z" }, + { url = "https://files.pythonhosted.org/packages/1e/74/220106da34502304b6751a2a9b8a9fbca6c3fd47e737a2e2e3da7c61c9db/tomli-2.5.0-cp311-cp311-win_amd64.whl", hash = "sha256:c804ae44fe7b4bab5da295e4f980a1ff04670bca9d23fe0a4e887e08ebd741a8", size = 112742, upload-time = "2026-10-07T12:22:24.972Z" }, + { url = "https://files.pythonhosted.org/packages/27/99/7d9c8b41837a7773613e169504147375c157a290167aa59ad74a085f521f/tomli-2.5.0-cp311-cp311-win_arm64.whl", hash = "sha256:cfac177ebd6236003846ea339981f71457cb6eb748f23381eb257e45092e3980", size = 109332, upload-time = "2026-10-07T12:22:26.117Z" }, + { url = "https://files.pythonhosted.org/packages/52/ed/7baa86f87493646a594de388c7c1c40a39dd0461f7e9c0359cbeefc91fe8/tomli-2.5.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:1f4a40d03fb9f63424f0979855bdeaf44dd7696b8d59501822c10ed30ba532df", size = 164854, upload-time = "2026-10-07T12:22:27.444Z" }, + { url = "https://files.pythonhosted.org/packages/a5/b1/44c0341f2224397855723c7a8a39f718ea6fcbcc3dacc66e5aeca0f334e3/tomli-2.5.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:9ebf8d19b17bd0daeb7b7dec81a946a439b753942fd0210d6e96c532249eea6b", size = 164074, upload-time = "2026-10-07T12:22:28.679Z" }, + { url = "https://files.pythonhosted.org/packages/23/04/e2d5b7d3fba47adedb23de616c16d428ea076c79a3d8e1d95d649ffe197e/tomli-2.5.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:bf0b5e8e0f68ebb494356e577c06c139161efd8d3b9050f93b39b7c26cc54ff0", size = 274274, upload-time = "2026-10-07T12:22:29.804Z" }, + { url = "https://files.pythonhosted.org/packages/43/90/6090e706ff27a6f89f4a40578e3324b95c3cd8c4150868aabf33a8f414c3/tomli-2.5.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6cf74416bdc94ae458b14e37286c1073081850ac8459a00d0c5efef5d44294c6", size = 286435, upload-time = "2026-10-07T12:22:31.297Z" }, + { url = "https://files.pythonhosted.org/packages/0a/9e/a2c40768df16c408f22430afb0a73e9d7e5f79c950884954649d1146b74d/tomli-2.5.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:61ea1ebe1e55a34ea8199cc8dbff398d35027b82271c8ac4802fd3a1fd5b1bcc", size = 278119, upload-time = "2026-10-07T12:22:32.601Z" }, + { url = "https://files.pythonhosted.org/packages/12/25/3c0cb485b98e9cfac495629b1c93c87ccf0b72fbe9d2689fd8fe62c6d5a3/tomli-2.5.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:ed53f7e89bb04f6d9e8e7799112360b0c4d5cbff067de0814c98c37c39b920f7", size = 286177, upload-time = "2026-10-07T12:22:33.745Z" }, + { url = "https://files.pythonhosted.org/packages/77/8b/0144c65f0e37e51c18d04ae15c21b19431c165002d0131fe9aa8b0b8b1e8/tomli-2.5.0-cp312-cp312-win32.whl", hash = "sha256:e7ad033e27a516a233bea839cdb77b80146facb3b4f40bf02cd0cac165cdd5c2", size = 102760, upload-time = "2026-10-07T12:22:34.887Z" }, + { url = "https://files.pythonhosted.org/packages/de/32/5d6d8f42fc9a05fce69354e00ff256484192f5f2fc9a2165718fa0de61ec/tomli-2.5.0-cp312-cp312-win_amd64.whl", hash = "sha256:bd05de8c1698f8413dd7d869492693a0bf2211543b787ac78cd5e7536af1a6d7", size = 112722, upload-time = "2026-10-07T12:22:36.162Z" }, + { url = "https://files.pythonhosted.org/packages/30/65/df18032218db0fb9b769fb23c8039a051f15c811993995ea04c350273a32/tomli-2.5.0-cp312-cp312-win_arm64.whl", hash = "sha256:069435bd5480429b98c5e5afb02ab21c219b6f0064680671c6dc0d46817346ea", size = 109534, upload-time = "2026-10-07T12:22:37.296Z" }, + { url = "https://files.pythonhosted.org/packages/42/e5/51736d70da209350969e15aca5c5ab6e2ce1ea87a0a892a6c13aec172a86/tomli-2.5.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:943276cf269e0071948d9ff697159c1735e623c1151d88abb09b74659ef0cbea", size = 163328, upload-time = "2026-10-07T12:22:38.373Z" }, + { url = "https://files.pythonhosted.org/packages/ec/55/086f80dab4ab497602644274e6dea7ec5dd0b4e262e443a8ad3bb7edee2d/tomli-2.5.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:463b16086865b97facd8d0b3fb4cb7c544e3f58d2a69dc3113d6db9653fdb043", size = 162246, upload-time = "2026-10-07T12:22:39.673Z" }, + { url = "https://files.pythonhosted.org/packages/aa/eb/3ecc94459f3635c92321f4e7bde571323fdb2267c50e19e3188a281eae3b/tomli-2.5.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1245a6638fc4bb0a60af38a7d45413db34a13842027c77597c712c998c62fdf0", size = 272655, upload-time = "2026-10-07T12:22:41.08Z" }, + { url = "https://files.pythonhosted.org/packages/c0/d7/494fd1f0c37a621f1ad9975c2efadb523e8101f144ed6edb2e7fe64738f2/tomli-2.5.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5d8bac3d603c97e6854424e5b2b5b741bdbde387e09f162fb0446812b4a8362b", size = 283595, upload-time = "2026-10-07T12:22:42.222Z" }, + { url = "https://files.pythonhosted.org/packages/70/51/bb8d62b1317e6640866f6949b2d5855e5300f2c99d46de1cd245570bba65/tomli-2.5.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:21e4cae4114aba25aa0d4f85cdf486d290fb35c0954d7bba536248da64d43066", size = 276253, upload-time = "2026-10-07T12:22:43.625Z" }, + { url = "https://files.pythonhosted.org/packages/66/f4/f46bd7f0763cd47de2db697dca9257c6a4adfd1a93b018cc75c8190ed5a8/tomli-2.5.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:bbaefc84548d754be821bba7c4141c4787dda182f9e77f2f87b71213529efa7b", size = 283582, upload-time = "2026-10-07T12:22:44.983Z" }, + { url = "https://files.pythonhosted.org/packages/ac/03/70f2bcb2923a6db37818d917e124270a7f4cfd38ea576f5aa753a91c0ef5/tomli-2.5.0-cp313-cp313-win32.whl", hash = "sha256:abdbf6313b8d9efe157edeb7ab6eae4de064b1300ad31abf73755154b30abe68", size = 102628, upload-time = "2026-10-07T12:22:46.508Z" }, + { url = "https://files.pythonhosted.org/packages/dc/98/d52024bb5b0ff68b4f0d276d867f634c84a67319a7e9f6b7708a37742333/tomli-2.5.0-cp313-cp313-win_amd64.whl", hash = "sha256:fd4dc129784e0c5335bd4e61dfcc4487499a013419e655cf2da1d091b7e0efdc", size = 113301, upload-time = "2026-10-07T12:22:47.647Z" }, + { url = "https://files.pythonhosted.org/packages/6f/f2/540db3a70572a8c23a28aba3e9c358ce0ffffbafc990905c1343aa265b31/tomli-2.5.0-cp313-cp313-win_arm64.whl", hash = "sha256:69491c143d2fe063046e0301e62a810bed338fa4d1ce0fd870c27dc1e09b0d84", size = 109744, upload-time = "2026-10-07T12:22:48.925Z" }, + { url = "https://files.pythonhosted.org/packages/e4/49/caf6b307766eb9567664a8707e9d6be5fcc0e8903f18781c6677a60d80c7/tomli-2.5.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:d3182ee2d887e507bd67319a0a61105d1dd33facc111329559a233b772c1a105", size = 162899, upload-time = "2026-10-07T12:22:50.088Z" }, + { url = "https://files.pythonhosted.org/packages/d3/c8/68cfce773a2733a49c74f99d627fb461bd990756860099eac25617889585/tomli-2.5.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:521345fd1f19d45b8df87657aaa38b6f2ca3800059fadf428e7ebf479a383646", size = 162080, upload-time = "2026-10-07T12:22:51.558Z" }, + { url = "https://files.pythonhosted.org/packages/7e/b2/e5bb8651fdad593f670501a7d718b1a7f73f064d44dea15e04c04dfef45d/tomli-2.5.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6e95c7614e705bfe2b04b27aa124adec59752d15813df37e2156747cab3a006b", size = 273380, upload-time = "2026-10-07T12:22:52.918Z" }, + { url = "https://files.pythonhosted.org/packages/8d/d2/9e2d7f8b1dfe0e2b34c245986ebd55c4c553ea4ce6c47c443b332673253f/tomli-2.5.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7ac2027d37c3afbdf4bdd377f2676f6f1d2122a5be1f1137b49dced590b37e75", size = 283228, upload-time = "2026-10-07T12:22:54.173Z" }, + { url = "https://files.pythonhosted.org/packages/ba/df/ec7b876b7b1a2718bd74a3743c076fff565b04029ba33e8f61fac262739f/tomli-2.5.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:c414be4ed9d3cac80c42e348fa5a956117d1a48227f48026e31f59cb4a7671eb", size = 277189, upload-time = "2026-10-07T12:22:55.342Z" }, + { url = "https://files.pythonhosted.org/packages/7d/7b/e192d9eed0b9cb80da799f4d77052297fb9a2c3cc9b19f571f56ea88add6/tomli-2.5.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:9b03d7dc168353b4132965bde20feceabaa470e570c6f59660dfae59b1f9eeb3", size = 283632, upload-time = "2026-10-07T12:22:56.735Z" }, + { url = "https://files.pythonhosted.org/packages/84/50/ff94454e75461d75623e47401ed323d65c10aab8fe9033242c20cd2fdf32/tomli-2.5.0-cp314-cp314-win32.whl", hash = "sha256:6f041843c4d3a37245c0c056fd955b186bf8b1fb85690cbe40b81230891dc34b", size = 103535, upload-time = "2026-10-07T12:22:58.084Z" }, + { url = "https://files.pythonhosted.org/packages/54/0b/bdacf05f963bd6026ebf6eeb0beda847d1d60e03e440725c64a4e08a0afd/tomli-2.5.0-cp314-cp314-win_amd64.whl", hash = "sha256:f4b653094e18f9031102d3a1da5c729c8f222d85225b18037dac621695e46e1a", size = 114621, upload-time = "2026-10-07T12:22:59.2Z" }, + { url = "https://files.pythonhosted.org/packages/61/99/53f438fa6ae4f9d4ed0ddde3e7242b3bdc34b48c8f9948b72b9e9b127676/tomli-2.5.0-cp314-cp314-win_arm64.whl", hash = "sha256:3f89d10c1ff6a38d992c27fc8a4816af71a909e08a40ec66934240b1e74347c3", size = 111572, upload-time = "2026-10-07T12:23:00.479Z" }, + { url = "https://files.pythonhosted.org/packages/b9/20/1f88f19427d380a40e90a770e087489eaafe4aeee070ae88ed2bbec00acd/tomli-2.5.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:e9e15b4a6c7dd6b85b5fbab29488a73f1f70de516942308daa266bf0e0aeb0d4", size = 171814, upload-time = "2026-10-07T12:23:01.914Z" }, + { url = "https://files.pythonhosted.org/packages/d0/56/cbe5079c9f9a54b9b3e27fc82f08f3cb36edee75561679f53d2380c801d6/tomli-2.5.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:e12bbcd32897272fb05929110362ae9ff4c1b9bb26bd9e971e71dcd3275b4c3d", size = 171324, upload-time = "2026-10-07T12:23:03.18Z" }, + { url = "https://files.pythonhosted.org/packages/2b/30/1d53fd3b0f1cb3ba542e345ec32c26aefdddc4e829e4f3429af8a4f27782/tomli-2.5.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:20aa36de8f2cf87237143bc1fa1aae8d6612c09118f4da21c6a684db5dd1f6f9", size = 297441, upload-time = "2026-10-07T12:23:04.345Z" }, + { url = "https://files.pythonhosted.org/packages/66/d9/0800acb6a111686f764c1b91ef15cc42a20a66a46013bb42220f1d2c61c1/tomli-2.5.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:22185fad8a1e622f064e78008018a0dd3323550dcb479cb7a1d296888d74024f", size = 307476, upload-time = "2026-10-07T12:23:05.671Z" }, + { url = "https://files.pythonhosted.org/packages/e8/63/30a8f3cd51b5bec37f04744bad0b0dc6160df84aad4f27b0e9283d66f221/tomli-2.5.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:984012f71908165449a951de2050d52f276bfe3aa5d5f570f63ddad814370374", size = 296113, upload-time = "2026-10-07T12:23:07.202Z" }, + { url = "https://files.pythonhosted.org/packages/ab/18/0b9ffc597e69c5a1e20a7823cb60d54b39a9f54e91edcb8574f022186758/tomli-2.5.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:f79203b3965b4000e91808aaa7c040206093f2b8bf86f455982f2274c9ccf442", size = 307725, upload-time = "2026-10-07T12:23:08.508Z" }, + { url = "https://files.pythonhosted.org/packages/ab/c7/18f8baae0b5607a60e8e19b4a7fedee43a8ff6458e3896dcbbadeeac9c22/tomli-2.5.0-cp314-cp314t-win32.whl", hash = "sha256:91294a9fb94a75542f6e46e4a2ae709bd8d9b51134098cae5cf3bea5478b6d03", size = 108546, upload-time = "2026-10-07T12:23:09.956Z" }, + { url = "https://files.pythonhosted.org/packages/72/34/4cca9739254130627bde87500b3f2b512154fe2f278efa7e2a5e10ad4bcb/tomli-2.5.0-cp314-cp314t-win_amd64.whl", hash = "sha256:f15e3e0b835a6d68b10c86bf80a3149780498d6911c93c3ffd1861d19f9200f1", size = 117814, upload-time = "2026-10-07T12:23:11.486Z" }, + { url = "https://files.pythonhosted.org/packages/7d/fb/afa530d47dd80a78fce43beac6bc6e00f84558eafcffbc6f37b21e80d056/tomli-2.5.0-cp314-cp314t-win_arm64.whl", hash = "sha256:6664b7ae7af7294256c53960a6103077f4914cec8ff98479c352f622c6f6b2f0", size = 115188, upload-time = "2026-10-07T12:23:12.728Z" }, + { url = "https://files.pythonhosted.org/packages/66/98/316fdc00f8c0939e6fe50461dd343c162d3ad51d1286eb25b7db54361d50/tomli-2.5.0-cp315-cp315-macosx_10_15_x86_64.whl", hash = "sha256:a525685c2f97da40762b8695eb7aa0af4c8344ca1905c73e4e29cb04d34607dc", size = 162775, upload-time = "2026-10-07T12:23:13.941Z" }, + { url = "https://files.pythonhosted.org/packages/c5/22/7b10fa5bb01c9539f53f69b619361b19350acc73657772ea7ac70ba309a8/tomli-2.5.0-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:9dbb18c1cfb2f6517942fc9314437f66aa06d94436ffb1f06102ef3572f35276", size = 161406, upload-time = "2026-10-07T12:23:15.215Z" }, + { url = "https://files.pythonhosted.org/packages/9c/e7/1a069d86dfd20f1f84f71c63faed9f83c1d890bc06c27d82dc7d888fb573/tomli-2.5.0-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:752e8b1aa6a4367ef8bf6a1a1e005540f7ed055ba36d7193796812ca5404eb52", size = 273855, upload-time = "2026-10-07T12:23:16.471Z" }, + { url = "https://files.pythonhosted.org/packages/ae/83/d1ef43d1687d092ab9c235455c76e6e709483b346b056f086095c7c263a5/tomli-2.5.0-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c47300f9bf791808f77d82747691c4bb09cb14bdf3060cca99b42cdc4361d5a7", size = 284910, upload-time = "2026-10-07T12:23:18.166Z" }, + { url = "https://files.pythonhosted.org/packages/cc/05/f4d9cf7de61822ece0c3873f30d291e324911c71a378b8bfe5ced13fd9f5/tomli-2.5.0-cp315-cp315-musllinux_1_2_aarch64.whl", hash = "sha256:19b0dd8749f4ea2f112c5fcfb3c5248390c899d7e2e173f1d91abee1fa0ff391", size = 277723, upload-time = "2026-10-07T12:23:19.355Z" }, + { url = "https://files.pythonhosted.org/packages/42/28/78262493141fa543151cf005760c3cb01d09fc28a11f993c05109902cb8c/tomli-2.5.0-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:57b1c3b01fab802e2899bc3d168dca320e14165e2fd9fd584760fb4ca5826859", size = 285115, upload-time = "2026-10-07T12:23:20.698Z" }, + { url = "https://files.pythonhosted.org/packages/1a/b9/e1dab9a30bcb677b5cc5cee810609cfd64f24306a3055767dd3fda00b1e0/tomli-2.5.0-cp315-cp315-win32.whl", hash = "sha256:667e521b37a6c5ccaa044202c235b530f90177ffe2cd4a64ecc213c7dd535feb", size = 103475, upload-time = "2026-10-07T12:23:21.941Z" }, + { url = "https://files.pythonhosted.org/packages/4c/bd/31a3790c11d6ea95fcf5e6022ac0f8d0543c9b61120b730fc481bd43d3b4/tomli-2.5.0-cp315-cp315-win_amd64.whl", hash = "sha256:d747252933c8a65ef6bd8da0fbb7ce28a90eb6119d8cd00772cd528aa07b68d5", size = 114589, upload-time = "2026-10-07T12:23:23.098Z" }, + { url = "https://files.pythonhosted.org/packages/47/a2/4f6310fa699364f0e3af7ee3af88dddd9af066d33e716a0265bbe2b3ea84/tomli-2.5.0-cp315-cp315-win_arm64.whl", hash = "sha256:75dbcde8751b0a960aa3de173aa5e894d590755c6d7758b7e774c06f1dc3cbdd", size = 111493, upload-time = "2026-10-07T12:23:24.233Z" }, + { url = "https://files.pythonhosted.org/packages/68/14/00853f0b396d8971107ae1921bb5b322fdee1650d2f16bf06c20adb532e5/tomli-2.5.0-cp315-cp315t-macosx_10_15_x86_64.whl", hash = "sha256:2419c2a189551987b59d80e63ec355671283336f41c6b9b89462df679c7d0c57", size = 171380, upload-time = "2026-10-07T12:23:25.512Z" }, + { url = "https://files.pythonhosted.org/packages/89/ad/fa6949321dadee46b27363974fb197b94c911c3b0f7a5fd26d7dc18fc2a0/tomli-2.5.0-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:0dc598040da8d42cf20f0be588ed7004f46db12a0ac6c32e03a59dccedaaadcd", size = 170553, upload-time = "2026-10-07T12:23:26.855Z" }, + { url = "https://files.pythonhosted.org/packages/53/aa/3056c919eb3e084df3752b2cf5f865dcc04af0b27dba2f66d7b28af4633a/tomli-2.5.0-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:49096930c8d886c9bbdab62d2d0d17ce823ddeea522309a190b36245d5b49e01", size = 294428, upload-time = "2026-10-07T12:23:28.132Z" }, + { url = "https://files.pythonhosted.org/packages/96/b2/faeeb5d8769ea3832021d73e892c8391eae7b4b4f8b55a789127bd8b18a9/tomli-2.5.0-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b8ade5023067f99fe72b88accd30d0ea05a158e9e32a11f124e731ea9695313f", size = 304909, upload-time = "2026-10-07T12:23:29.381Z" }, + { url = "https://files.pythonhosted.org/packages/f6/52/f094c09e73fb654b621716d019acb5d29bdfd1be01df80c281d552bda48d/tomli-2.5.0-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:b69564772b5c8f22ea5f498dff08cfa825045b4d4c4400529000bdf818aa3b2a", size = 293220, upload-time = "2026-10-07T12:23:30.608Z" }, + { url = "https://files.pythonhosted.org/packages/86/f5/0c30541078ca4b505ce3bd76ed931facbfec524dd018535d691d1af0a6d2/tomli-2.5.0-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:8ff3a2ca028c7eee0c777f9a092038d0a594a9fa04e215f929a22c329e2cb142", size = 305705, upload-time = "2026-10-07T12:23:32.181Z" }, + { url = "https://files.pythonhosted.org/packages/05/74/590e7d19d6a118fc5cc5704ff358e21d95b8573f6b9443b1519f29ca8825/tomli-2.5.0-cp315-cp315t-win32.whl", hash = "sha256:62fc1bc8eb03e3a9cadfca713d65614ed8e09d974a283295ffe3a831976b4dc5", size = 108432, upload-time = "2026-10-07T12:23:33.496Z" }, + { url = "https://files.pythonhosted.org/packages/1c/b8/63a75cfb27a17c38550e44025d3a6e7be64516fd8608a3b75703bf37d81b/tomli-2.5.0-cp315-cp315t-win_amd64.whl", hash = "sha256:f3fcbc57b1791fa6cbe5d8434179d51de12be1a4811469529f47f6e7487a2571", size = 117281, upload-time = "2026-10-07T12:23:34.648Z" }, + { url = "https://files.pythonhosted.org/packages/72/01/e8c1debb2173973372934c68fc8e46170ab60ef23ed4592dff4dec6e8993/tomli-2.5.0-cp315-cp315t-win_arm64.whl", hash = "sha256:d2ba24db8a9376921b5e87b4762b9adb0f3f1deaea68f2b8b0bb2c11efb9c3e7", size = 115069, upload-time = "2026-10-07T12:23:35.77Z" }, + { url = "https://files.pythonhosted.org/packages/60/3f/3e3f8fd0919249b0200c80fbc4f9a1e70be19f9883da71dfb7f8b9ab8aca/tomli-2.5.0-py3-none-any.whl", hash = "sha256:32a7b79ac57a2e83670ce329ccf675798bc5a2094783a63676866b70503f2e2b", size = 14765, upload-time = "2026-10-07T12:23:36.875Z" }, ] -[package.metadata] -requires-dist = [ - { name = "python-dotenv", specifier = ">=1.2.4" }, - { name = "requests", specifier = ">=2.34.2" }, +[[package]] +name = "typing-extensions" +version = "4.16.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f6/cc/6253133b5bb138fc3306cebfbda2c520f545d36b5be2c7255cc528bb45d6/typing_extensions-4.16.0.tar.gz", hash = "sha256:dc983d19a509c94dba722ee6abd33940f7c05a89e243c47e907eb4db6f1a43e5", size = 113555, upload-time = "2026-07-02T08:40:05.92Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/49/d3/b8441a820a491ddfc024b0b0cf0393375b75ea13866d9c66727e54c2fc80/typing_extensions-4.16.0-py3-none-any.whl", hash = "sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8", size = 45571, upload-time = "2026-07-02T08:40:04.659Z" }, ] [[package]] -name = "urllib3" -version = "2.8.0" +name = "typing-inspection" +version = "0.4.4" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/e3/05/b17359e1cefb4f909b5e40b1b90a496d987258916dbbf88e842c729f510e/urllib3-2.8.0.tar.gz", hash = "sha256:63bf2ead4c879426ebf22ef2a781eeb4aa3b4ae798a0435506f8687fd5bb9b63", size = 458972, upload-time = "2026-09-15T19:29:36.253Z" } +dependencies = [ + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/a3/26/b09b8010994eccc3c09092e6b34058f36a460eea2d4c3e8b910c695975a0/typing_inspection-0.4.4.tar.gz", hash = "sha256:547274fa6b0a561ccf549cc9524b999a578e737d015d8709d021f9d0d13bea47", size = 76928, upload-time = "2026-08-12T12:37:25.997Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/92/9d/c4e665119135114480843e7ab388fa94d8480650450e6f8e26b70d323a4c/urllib3-2.8.0-py3-none-any.whl", hash = "sha256:0cf3cae568d36aa9576b28dfb35f11328f1cb974ca7647d9475ebb86c75ac6e3", size = 135717, upload-time = "2026-09-15T19:29:34.577Z" }, + { url = "https://files.pythonhosted.org/packages/67/81/4add07e5172b7ac40d8ed5ff580409a7801a4fe26d529bdd915401dabfbe/typing_inspection-0.4.4-py3-none-any.whl", hash = "sha256:65b8397ba37ccbce054456aaccddfc91e6e3083c92824df348d96ca832f3f147", size = 14750, upload-time = "2026-08-12T12:37:24.648Z" }, ] From 187e0aff796ab48af9bef3e4658b089e0adec494 Mon Sep 17 00:00:00 2001 From: Vianney Mixtur Date: Sun, 25 Oct 2026 18:04:07 +0100 Subject: [PATCH 2/9] S2 Add answer models, errors and recorded API fixtures Answer models cover every Clairic response shape: text, number, date, time, datetime, duration, text lists, number and date lists, numeric and date estimates, and forecasts. Shapes and semantics come from responses recorded against the live API on 2026-10-25, now stored under tests/fixtures/responses (account id redacted). response.json moves there as invoice.json. errors.py defines the exception hierarchy and ClairicTruncationWarning. Co-Authored-By: Claude Opus 5.5 --- response.json | 83 -- src/clairic/answers.py | 374 +++++++++ src/clairic/errors.py | 97 +++ tests/fixtures/responses/err_bad_account.json | 27 + .../responses/err_bad_duration_unit.json | 29 + .../responses/err_bad_name_digit.json | 28 + .../fixtures/responses/err_bad_name_long.json | 28 + .../responses/err_bad_name_space.json | 28 + .../responses/err_bad_reference_date.json | 29 + tests/fixtures/responses/err_bad_step.json | 31 + tests/fixtures/responses/err_bad_token.json | 27 + tests/fixtures/responses/err_bad_type.json | 28 + tests/fixtures/responses/err_decimals_7.json | 29 + .../fixtures/responses/err_empty_fields.json | 24 + tests/fixtures/responses/err_empty_state.json | 28 + .../responses/err_estimate_min_ge_max.json | 30 + .../responses/err_estimate_no_bounds.json | 28 + tests/fixtures/responses/err_horizon_65.json | 31 + .../fixtures/responses/err_list_no_items.json | 28 + .../responses/err_malformed_json.json | 19 + .../responses/err_missing_fields.json | 23 + tests/fixtures/responses/err_no_token.json | 27 + .../responses/err_null_threshold_zero.json | 29 + .../responses/err_option_on_wrong_type.json | 30 + .../responses/err_state_not_string.json | 28 + .../responses/err_unknown_field_key.json | 29 + .../responses/err_unknown_option.json | 31 + .../responses/err_unknown_top_key.json | 29 + tests/fixtures/responses/err_wrong_model.json | 28 + .../responses/estimate_no_quantiles.json | 52 ++ .../responses/estimate_quantiles.json | 743 ++++++++++++++++++ .../responses/estimate_step_year.json | 49 ++ .../responses/forecast_no_interval.json | 92 +++ tests/fixtures/responses/forecast_ok.json | 649 +++++++++++++++ tests/fixtures/responses/invoice.json | 123 +++ tests/fixtures/responses/missing_model.json | 42 + tests/fixtures/responses/model_full_name.json | 43 + .../responses/options_state_text.json | 93 +++ tests/fixtures/responses/trunc_10k.json | 67 ++ tests/fixtures/responses/trunc_70k.json | 36 + tests/fixtures/responses/types_absent.json | 139 ++++ tests/fixtures/responses/types_present.json | 193 +++++ tests/recorded.py | 35 + tests/test_answers.py | 181 +++++ 44 files changed, 3734 insertions(+), 83 deletions(-) delete mode 100644 response.json create mode 100644 src/clairic/answers.py create mode 100644 src/clairic/errors.py create mode 100644 tests/fixtures/responses/err_bad_account.json create mode 100644 tests/fixtures/responses/err_bad_duration_unit.json create mode 100644 tests/fixtures/responses/err_bad_name_digit.json create mode 100644 tests/fixtures/responses/err_bad_name_long.json create mode 100644 tests/fixtures/responses/err_bad_name_space.json create mode 100644 tests/fixtures/responses/err_bad_reference_date.json create mode 100644 tests/fixtures/responses/err_bad_step.json create mode 100644 tests/fixtures/responses/err_bad_token.json create mode 100644 tests/fixtures/responses/err_bad_type.json create mode 100644 tests/fixtures/responses/err_decimals_7.json create mode 100644 tests/fixtures/responses/err_empty_fields.json create mode 100644 tests/fixtures/responses/err_empty_state.json create mode 100644 tests/fixtures/responses/err_estimate_min_ge_max.json create mode 100644 tests/fixtures/responses/err_estimate_no_bounds.json create mode 100644 tests/fixtures/responses/err_horizon_65.json create mode 100644 tests/fixtures/responses/err_list_no_items.json create mode 100644 tests/fixtures/responses/err_malformed_json.json create mode 100644 tests/fixtures/responses/err_missing_fields.json create mode 100644 tests/fixtures/responses/err_no_token.json create mode 100644 tests/fixtures/responses/err_null_threshold_zero.json create mode 100644 tests/fixtures/responses/err_option_on_wrong_type.json create mode 100644 tests/fixtures/responses/err_state_not_string.json create mode 100644 tests/fixtures/responses/err_unknown_field_key.json create mode 100644 tests/fixtures/responses/err_unknown_option.json create mode 100644 tests/fixtures/responses/err_unknown_top_key.json create mode 100644 tests/fixtures/responses/err_wrong_model.json create mode 100644 tests/fixtures/responses/estimate_no_quantiles.json create mode 100644 tests/fixtures/responses/estimate_quantiles.json create mode 100644 tests/fixtures/responses/estimate_step_year.json create mode 100644 tests/fixtures/responses/forecast_no_interval.json create mode 100644 tests/fixtures/responses/forecast_ok.json create mode 100644 tests/fixtures/responses/invoice.json create mode 100644 tests/fixtures/responses/missing_model.json create mode 100644 tests/fixtures/responses/model_full_name.json create mode 100644 tests/fixtures/responses/options_state_text.json create mode 100644 tests/fixtures/responses/trunc_10k.json create mode 100644 tests/fixtures/responses/trunc_70k.json create mode 100644 tests/fixtures/responses/types_absent.json create mode 100644 tests/fixtures/responses/types_present.json create mode 100644 tests/recorded.py create mode 100644 tests/test_answers.py diff --git a/response.json b/response.json deleted file mode 100644 index 439fe1a..0000000 --- a/response.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "result": { - "model": "clairic", - "answers": { - "invoice_number": { - "type": "text", - "p_null": 5.542365670407889e-06, - "span": [ - 8, - 16 - ], - "guess": "INV-2291", - "confidence": 0.9999814033508301, - "value": "INV-2291" - }, - "due_date": { - "type": "date", - "p_null": 9.57318320615741e-07, - "guess": "2026-10-02", - "confidence": 0.9999649532931155, - "value": "2026-10-02" - }, - "total": { - "type": "number", - "p_null": 5.512222855941218e-07, - "guess": 1080, - "confidence": 0.9999504107534636, - "value": 1080 - }, - "contacts": { - "type": "list", - "value": [ - "Dana Ruiz", - "Priya Shah" - ], - "spans": [ - [ - 120, - 129 - ], - [ - 131, - 141 - ] - ], - "confidence": 0.9998327756466797 - }, - "po_number": { - "type": "text", - "p_null": 0.9999994039535522, - "span": [ - 8, - 16 - ], - "guess": "INV-2291", - "confidence": 0.9992349147796631, - "value": null - }, - "days_to_pay": { - "type": "estimate", - "value": 31, - "mean": 30.936103609225793, - "median": 31, - "p10": 24, - "p90": 37, - "p_below": 2.312706328666536e-06, - "p_above": 5.760749445471447e-06 - } - }, - "truncated": false, - "usage": { - "state_tokens": 61, - "image_tokens": 0, - "schema_tokens": 472, - "input_tokens": 655, - "output_tokens": 0, - "passes": 3 - } - }, - "success": true, - "errors": [], - "messages": [] -} \ No newline at end of file diff --git a/src/clairic/answers.py b/src/clairic/answers.py new file mode 100644 index 0000000..a38d231 --- /dev/null +++ b/src/clairic/answers.py @@ -0,0 +1,374 @@ +"""Typed answers returned by Clairic, one class per response shape. + +Declare an extraction model by annotating each field with one of these classes. The class +chooses the Clairic field type, and after extraction the field holds the answer: the value and +the metadata Clairic attaches to it. + +Clairic answers a field with `value = None` when the input does not determine it. Single-value +answers carry a confidence score and the probability that the value is absent (`p_null`). +Estimates and forecasts carry a distribution. Typed output constrains the shape of an answer, +not its correctness: use `confidence`, `p_null` and the percentile range to decide which +answers to act on and which to review. + +Source: https://developers.cloudflare.com/workers-ai/concepts/extraction-models/ +""" + +from __future__ import annotations + +import datetime as dt +from typing import Generic, Literal, NamedTuple, TypeVar + +from pydantic import BaseModel, ConfigDict + +__all__ = [ + "Answer", + "DateAnswer", + "DateEstimateAnswer", + "DatetimeAnswer", + "DurationAnswer", + "DurationUnit", + "EstimateAnswer", + "ForecastAnswer", + "ForecastStep", + "ListAnswer", + "NumberAnswer", + "Span", + "TextAnswer", + "TextListAnswer", + "TimeAnswer", +] + +N = TypeVar("N", int, float) +"""Numeric value type of an answer: `int` sends `integer: true` to Clairic.""" + +V = TypeVar("V", int, float, dt.date) +"""Item type of a number or date list.""" + +DurationUnit = Literal["seconds", "minutes", "hours", "days", "weeks", "months", "years"] +"""Unit in which Clairic expresses a duration.""" + + +class Span(NamedTuple): + """Location of an extracted text in the input, as end-exclusive character offsets. + + `state[span.start:span.end]` returns the extracted text. + + Usage: + >>> state = "Invoice INV-2291 from Northwind Supply" + >>> span = Span(8, 16) + >>> state[span.start : span.end] + 'INV-2291' + """ + + start: int + end: int + + +class Answer(BaseModel): + """Base class of every Clairic answer. + + Answers are immutable. Keys Clairic adds in the future are kept and readable through + `model_extra`. + """ + + model_config = ConfigDict(frozen=True, extra="allow") + + +class _SingleValueAnswer(Answer): + """Answer to a field with a single value: text, number, date, time, datetime, duration. + + Attributes: + p_null: float + Probability that the input does not contain or determine the value. `value` is + `None` when it exceeds the field's `null_threshold` (default 0.5). + confidence: float + Probability that `guess` is the correct value, given that a value exists. + """ + + p_null: float + confidence: float + + +class TextAnswer(_SingleValueAnswer): + """Answer to a `text` field: an exact span of the input. + + `guess` and `span` describe the best candidate even when `value` is `None`, which lets you + show a reviewer what Clairic considered before deciding the value was absent. + + Attributes: + value: str | None + The extracted text, or `None` when the input does not contain it. + guess: str | None + The best candidate text, reported even when `value` is `None`. + span: Span | None + Location of `guess` in the input. + """ + + type: Literal["text"] = "text" + value: str | None + guess: str | None = None + span: Span | None = None + + +class NumberAnswer(_SingleValueAnswer, Generic[N]): + """Answer to a `number` field, read from the input or computed from it. + + Parametrize with `int` for whole numbers (`NumberAnswer[int]` sends `integer: true`) or with + `float`. Clairic rounds to the field's `decimals` and returns numbers without trailing + zeros (`1080` for a two-decimal amount). Multi-step arithmetic is not yet reliable: prefer + extracting the operands and computing in code. + + Attributes: + value: N | None + The number, or `None` when the input does not determine it. + guess: N | None + The best candidate number, reported even when `value` is `None`. + """ + + type: Literal["number"] = "number" + value: N | None + guess: N | None = None + + +class DateAnswer(_SingleValueAnswer): + """Answer to a `date` field, read from the input or worked out from it. + + Pass `reference_date` when extracting to anchor dates written without a year and relative + dates such as "net 30". + + Attributes: + value: date | None + The date, or `None` when the input does not determine it. + guess: date | None + The best candidate date, reported even when `value` is `None`. + """ + + type: Literal["date"] = "date" + value: dt.date | None + guess: dt.date | None = None + + +class TimeAnswer(_SingleValueAnswer): + """Answer to a `time` field: a time of day, without time zone. + + Attributes: + value: time | None + The time, or `None` when the input does not determine it. + guess: time | None + The best candidate time, reported even when `value` is `None`. + """ + + type: Literal["time"] = "time" + value: dt.time | None + guess: dt.time | None = None + + +class DatetimeAnswer(_SingleValueAnswer): + """Answer to a `datetime` field: a date and time of day, without time zone. + + Attributes: + value: datetime | None + The date and time, or `None` when the input does not determine them. + guess: datetime | None + The best candidate, reported even when `value` is `None`. + """ + + type: Literal["datetime"] = "datetime" + value: dt.datetime | None + guess: dt.datetime | None = None + + +class DurationAnswer(_SingleValueAnswer, Generic[N]): + """Answer to a `duration` field: a length of time expressed in `unit`. + + Parametrize with `int` for whole units (`DurationAnswer[int]` sends `integer: true`) or with + `float`. Choose the unit with the `Duration` spec; it defaults to seconds. + + Attributes: + value: N | None + The duration in `unit`, or `None` when the input does not determine it. + guess: N | None + The best candidate duration, reported even when `value` is `None`. + unit: DurationUnit + The unit of `value` and `guess`. + """ + + type: Literal["duration"] = "duration" + value: N | None + guess: N | None = None + unit: DurationUnit + + +class TextListAnswer(Answer): + """Answer to a `list` field of text items: every matching span of the input, in order. + + An empty list means nothing in the input matches. + + Attributes: + value: list[str] + The extracted texts, in input order. + spans: list[Span] + Location of each item of `value` in the input. + confidence: float + Confidence in the list as a whole. + """ + + type: Literal["list"] = "list" + value: list[str] + spans: list[Span] + confidence: float + + +class ListAnswer(Answer, Generic[V]): + """Answer to a `list` field of numbers or dates, in input order. + + Parametrize with `int`, `float` or `date`. For a list of text, use `TextListAnswer`. An + empty list means nothing in the input matches. + + Attributes: + value: list[V] + The extracted items, in input order. + confidences: list[float] + Confidence in each item of `value`. + confidence: float + Confidence in the list as a whole. + """ + + type: Literal["list"] = "list" + value: list[V] + confidences: list[float] + confidence: float + + +class EstimateAnswer(Answer, Generic[N]): + """Answer to a numeric `estimate` field: a distribution over the `[min, max]` range. + + An estimate predicts a value the input does not state, such as a likely sale price, from the + evidence the input contains. The 80% interval from `p10` to `p90` is calibrated on + Cloudflare's measurements, which does not guarantee that a given outcome falls inside it. + Intervals can be too narrow on unfamiliar data. + + Attributes: + value: N | None + Point estimate: the mean rounded to the field's `step` grid. + mean: float + Mean of the distribution. + median: N + 50th percentile. + p10: N + 10th percentile, lower bound of the 80% interval. + p90: N + 90th percentile, upper bound of the 80% interval. + p_below: float + Probability mass below `min`. + p_above: float + Probability mass above `max`. + quantiles: list[N] | None + Percentiles 1 to 99 (`quantiles[9] == p10`), when requested with + `include_quantiles`. + """ + + type: Literal["estimate"] = "estimate" + value: N | None + mean: float + median: N + p10: N + p90: N + p_below: float + p_above: float + quantiles: list[N] | None = None + + +class DateEstimateAnswer(Answer): + """Answer to an `estimate` field with date bounds: a distribution over dates. + + With a `"month"` or `"year"` step, every date is the first day of its period. + + Attributes: + value: date | None + Point estimate: the mean date rounded to the field's `step` grid. + mean: date + Mean of the distribution. + median: date + 50th percentile. + p10: date + 10th percentile, lower bound of the 80% interval. + p90: date + 90th percentile, upper bound of the 80% interval. + quantiles: list[date] | None + Percentiles 1 to 99, when requested with `include_quantiles`. + """ + + type: Literal["estimate"] = "estimate" + value: dt.date | None + mean: dt.date + median: dt.date + p10: dt.date + p90: dt.date + quantiles: list[dt.date] | None = None + + +class ForecastStep(BaseModel): + """Estimate for one future step of a forecast series. + + Attributes: + value: float + Point forecast for the step. + mean: float + Mean of the step's distribution. + median: float + 50th percentile. + p10: float + 10th percentile, lower bound of the 80% interval. + p90: float + 90th percentile, upper bound of the 80% interval. + p_below: float + Probability mass below `min`. + p_above: float + Probability mass above `max`. + quantiles: list[float] | None + Percentiles 1 to 99, when requested with `include_quantiles`. + """ + + model_config = ConfigDict(frozen=True, extra="allow") + + value: float + mean: float + median: float + p10: float + p90: float + p_below: float + p_above: float + quantiles: list[float] | None = None + + +class ForecastAnswer(Answer): + """Answer to a `forecast` field: one estimate per future step of a series. + + Clairic reads the history as plain text in the input (a CSV export, a pasted table, rows + mixed with notes) and forecasts `horizon` steps ahead within `[min, max]`. It learns patterns + from the series only, so events the series does not show, such as holidays, are missed. + Forecasting is basic and does not replace a dedicated time-series model. + + The parallel lists hold one entry per step. `steps` holds the same per-step figures together + with the mean and tail probabilities. + + Attributes: + value: list[float] + Point forecast for each step. + median: list[float] + 50th percentile for each step. + p10: list[float] + 10th percentile for each step. + p90: list[float] + 90th percentile for each step. + steps: list[ForecastStep] + Full estimate for each step. + """ + + type: Literal["forecast"] = "forecast" + value: list[float] + median: list[float] + p10: list[float] + p90: list[float] + steps: list[ForecastStep] diff --git a/src/clairic/errors.py b/src/clairic/errors.py new file mode 100644 index 0000000..a027ae7 --- /dev/null +++ b/src/clairic/errors.py @@ -0,0 +1,97 @@ +"""Exceptions and warnings raised by the clairic SDK.""" + +from __future__ import annotations + +__all__ = [ + "APIConnectionError", + "APIError", + "APITimeoutError", + "AuthenticationError", + "ClairicConfigurationError", + "ClairicError", + "ClairicTruncationWarning", + "ContextWindowExceededError", + "InvalidRequestError", + "ModelDefinitionError", +] + + +class ClairicError(Exception): + """Base class of every exception raised by the clairic SDK.""" + + +class ClairicConfigurationError(ClairicError): + """Raised when the client is missing its Cloudflare account id or API token.""" + + +class ModelDefinitionError(ClairicError): + """Raised when an extraction model cannot be turned into Clairic fields. + + Raised before any request is sent. The message names the offending field. + """ + + +class APIError(ClairicError): + """Raised when the Cloudflare API answers with an error. + + Attributes: + message: str + Error message returned by Cloudflare. + status_code: int + HTTP status of the response. + code: int | None + Cloudflare error code, such as 3030 for a request the model rejects. + request_id: str | None + Workers AI request id (`cf-ai-req-id` header), to quote when contacting Cloudflare. + """ + + def __init__( + self, + message: str, + *, + status_code: int, + code: int | None = None, + request_id: str | None = None, + ) -> None: + super().__init__(message) + self.message = message + self.status_code = status_code + self.code = code + self.request_id = request_id + + def __str__(self) -> str: + return f"{self.message} (HTTP {self.status_code}, code {self.code})" + + +class AuthenticationError(APIError): + """Raised on HTTP 401: the API token is missing or invalid, or the account id is unknown.""" + + +class InvalidRequestError(APIError): + """Raised when Cloudflare rejects the request content. + + Covers schema violations (HTTP 400, code 5006), field definitions the model rejects + (HTTP 422, code 3030) and malformed bodies (HTTP 400, code 6003). + """ + + +class ContextWindowExceededError(APIError): + """Raised on HTTP 413: the input is estimated to exceed Clairic's 65,536-token context window. + + Cloudflare estimates the input size from its length in characters before tokenizing it. + """ + + +class APIConnectionError(ClairicError): + """Raised when the Cloudflare API cannot be reached.""" + + +class APITimeoutError(APIConnectionError): + """Raised when the Cloudflare API does not answer within the client timeout.""" + + +class ClairicTruncationWarning(UserWarning): + """Emitted when Clairic reports `truncated: true`: answers were computed on part of the input. + + Turn it into an error with `warnings.simplefilter("error", ClairicTruncationWarning)`. + """ diff --git a/tests/fixtures/responses/err_bad_account.json b/tests/fixtures/responses/err_bad_account.json new file mode 100644 index 0000000..0198a91 --- /dev/null +++ b/tests/fixtures/responses/err_bad_account.json @@ -0,0 +1,27 @@ +{ + "status": 401, + "headers": { + "Content-Type": "application/json", + "CF-RAY": "a502a0bd7dd7d140-CDG" + }, + "request": { + "model": "clairic", + "state": "Total $10.", + "fields": { + "total": { + "type": "number" + } + } + }, + "response": { + "result": null, + "success": false, + "errors": [ + { + "code": 10000, + "message": "Authentication error" + } + ], + "messages": [] + } +} diff --git a/tests/fixtures/responses/err_bad_duration_unit.json b/tests/fixtures/responses/err_bad_duration_unit.json new file mode 100644 index 0000000..753450e --- /dev/null +++ b/tests/fixtures/responses/err_bad_duration_unit.json @@ -0,0 +1,29 @@ +{ + "status": 422, + "headers": { + "Content-Type": "application/json", + "cf-ai-req-id": "e5148cb1-315d-449f-9f0a-a5527c870710", + "CF-RAY": "a502a0e619680371-CDG" + }, + "request": { + "model": "clairic", + "state": "Total $10.", + "fields": { + "x": { + "type": "duration", + "unit": "fortnights" + } + } + }, + "response": { + "errors": [ + { + "message": "AiError: AiError: duration x needs a unit in ('seconds', 'minutes', 'hours', 'days', 'weeks', 'months', 'years') (e5148cb1-315d-449f-9f0a-a5527c870710)", + "code": 3030 + } + ], + "success": false, + "result": {}, + "messages": [] + } +} diff --git a/tests/fixtures/responses/err_bad_name_digit.json b/tests/fixtures/responses/err_bad_name_digit.json new file mode 100644 index 0000000..5641c91 --- /dev/null +++ b/tests/fixtures/responses/err_bad_name_digit.json @@ -0,0 +1,28 @@ +{ + "status": 422, + "headers": { + "Content-Type": "application/json", + "cf-ai-req-id": "c0320fcb-f9ef-4291-82fb-68eb84025d34", + "CF-RAY": "a502a0cd8a3e7ae7-CDG" + }, + "request": { + "model": "clairic", + "state": "Total $10.", + "fields": { + "1total": { + "type": "number" + } + } + }, + "response": { + "errors": [ + { + "message": "AiError: AiError: invalid field name '1total' (c0320fcb-f9ef-4291-82fb-68eb84025d34)", + "code": 3030 + } + ], + "success": false, + "result": {}, + "messages": [] + } +} diff --git a/tests/fixtures/responses/err_bad_name_long.json b/tests/fixtures/responses/err_bad_name_long.json new file mode 100644 index 0000000..dfc877b --- /dev/null +++ b/tests/fixtures/responses/err_bad_name_long.json @@ -0,0 +1,28 @@ +{ + "status": 422, + "headers": { + "Content-Type": "application/json", + "cf-ai-req-id": "6ba269cf-c90a-47ea-9f6f-708d34a9c232", + "CF-RAY": "a502a0d0d93f58fb-CDG" + }, + "request": { + "model": "clairic", + "state": "Total $10.", + "fields": { + "ttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt": { + "type": "number" + } + } + }, + "response": { + "errors": [ + { + "message": "AiError: AiError: invalid field name 'ttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt' (6ba269cf-c90a-47ea-9f6f-708d34a9c232)", + "code": 3030 + } + ], + "success": false, + "result": {}, + "messages": [] + } +} diff --git a/tests/fixtures/responses/err_bad_name_space.json b/tests/fixtures/responses/err_bad_name_space.json new file mode 100644 index 0000000..4b72876 --- /dev/null +++ b/tests/fixtures/responses/err_bad_name_space.json @@ -0,0 +1,28 @@ +{ + "status": 422, + "headers": { + "Content-Type": "application/json", + "cf-ai-req-id": "326a6229-41ee-4c41-8078-f76d4d34c58b", + "CF-RAY": "a502a0cebd7a02cd-CDG" + }, + "request": { + "model": "clairic", + "state": "Total $10.", + "fields": { + "to tal": { + "type": "number" + } + } + }, + "response": { + "errors": [ + { + "message": "AiError: AiError: invalid field name 'to tal' (326a6229-41ee-4c41-8078-f76d4d34c58b)", + "code": 3030 + } + ], + "success": false, + "result": {}, + "messages": [] + } +} diff --git a/tests/fixtures/responses/err_bad_reference_date.json b/tests/fixtures/responses/err_bad_reference_date.json new file mode 100644 index 0000000..1cb1450 --- /dev/null +++ b/tests/fixtures/responses/err_bad_reference_date.json @@ -0,0 +1,29 @@ +{ + "status": 422, + "headers": { + "Content-Type": "application/json", + "cf-ai-req-id": "d82433eb-2ac3-4289-abd5-ec540c80eeee", + "CF-RAY": "a502a0e77dd00084-CDG" + }, + "request": { + "model": "clairic", + "state": "Total $10.", + "fields": { + "total": { + "type": "number" + } + }, + "reference_date": "03/09/2026" + }, + "response": { + "errors": [ + { + "message": "AiError: AiError: reference_date must be an ISO date, got '03/09/2026' (d82433eb-2ac3-4289-abd5-ec540c80eeee)", + "code": 3030 + } + ], + "success": false, + "result": {}, + "messages": [] + } +} diff --git a/tests/fixtures/responses/err_bad_step.json b/tests/fixtures/responses/err_bad_step.json new file mode 100644 index 0000000..a64bb85 --- /dev/null +++ b/tests/fixtures/responses/err_bad_step.json @@ -0,0 +1,31 @@ +{ + "status": 422, + "headers": { + "Content-Type": "application/json", + "cf-ai-req-id": "8f927e85-e028-4d8e-8169-1ccdd7f25fd3", + "CF-RAY": "a502a0e01931743f-CDG" + }, + "request": { + "model": "clairic", + "state": "Total $10.", + "fields": { + "x": { + "type": "estimate", + "min": 0, + "max": 10, + "step": "week" + } + } + }, + "response": { + "errors": [ + { + "message": "AiError: AiError: estimate x: step must be a positive number, got 'week' (8f927e85-e028-4d8e-8169-1ccdd7f25fd3)", + "code": 3030 + } + ], + "success": false, + "result": {}, + "messages": [] + } +} diff --git a/tests/fixtures/responses/err_bad_token.json b/tests/fixtures/responses/err_bad_token.json new file mode 100644 index 0000000..de21674 --- /dev/null +++ b/tests/fixtures/responses/err_bad_token.json @@ -0,0 +1,27 @@ +{ + "status": 401, + "headers": { + "Content-Type": "application/json", + "CF-RAY": "a502a0bcad2debac-CDG" + }, + "request": { + "model": "clairic", + "state": "Total $10.", + "fields": { + "total": { + "type": "number" + } + } + }, + "response": { + "result": null, + "success": false, + "errors": [ + { + "code": 10000, + "message": "Authentication error" + } + ], + "messages": [] + } +} diff --git a/tests/fixtures/responses/err_bad_type.json b/tests/fixtures/responses/err_bad_type.json new file mode 100644 index 0000000..83e5bcc --- /dev/null +++ b/tests/fixtures/responses/err_bad_type.json @@ -0,0 +1,28 @@ +{ + "status": 400, + "headers": { + "Content-Type": "application/json", + "cf-ai-req-id": "d0719202-89c7-4fb7-8bed-1794dffa0b92", + "CF-RAY": "a502a0c388337848-CDG" + }, + "request": { + "model": "clairic", + "state": "Total $10.", + "fields": { + "x": { + "type": "money" + } + } + }, + "response": { + "errors": [ + { + "message": "AiError: Bad input: Error: enum money not in text,number,date,time,datetime,duration,list,estimate,forecast at '/x/type' (d0719202-89c7-4fb7-8bed-1794dffa0b92)", + "code": 5006 + } + ], + "success": false, + "result": {}, + "messages": [] + } +} diff --git a/tests/fixtures/responses/err_decimals_7.json b/tests/fixtures/responses/err_decimals_7.json new file mode 100644 index 0000000..586b18b --- /dev/null +++ b/tests/fixtures/responses/err_decimals_7.json @@ -0,0 +1,29 @@ +{ + "status": 400, + "headers": { + "Content-Type": "application/json", + "cf-ai-req-id": "4e9fe292-2e56-485c-837b-4d8629573f83", + "CF-RAY": "a502a0db2cc7d494-CDG" + }, + "request": { + "model": "clairic", + "state": "Total $10.", + "fields": { + "x": { + "type": "number", + "decimals": 7 + } + } + }, + "response": { + "errors": [ + { + "message": "AiError: Bad input: Error: '/x/decimals' must be <= 6 (4e9fe292-2e56-485c-837b-4d8629573f83)", + "code": 5006 + } + ], + "success": false, + "result": {}, + "messages": [] + } +} diff --git a/tests/fixtures/responses/err_empty_fields.json b/tests/fixtures/responses/err_empty_fields.json new file mode 100644 index 0000000..351d3f0 --- /dev/null +++ b/tests/fixtures/responses/err_empty_fields.json @@ -0,0 +1,24 @@ +{ + "status": 400, + "headers": { + "Content-Type": "application/json", + "cf-ai-req-id": "22d16144-e1e9-4198-87b6-bcae6520016d", + "CF-RAY": "a502a0bdef809ef2-CDG" + }, + "request": { + "model": "clairic", + "state": "Total $10.", + "fields": {} + }, + "response": { + "errors": [ + { + "message": "AiError: Bad input: Error: required properties at '/' are 'model,fields' (22d16144-e1e9-4198-87b6-bcae6520016d)", + "code": 5006 + } + ], + "success": false, + "result": {}, + "messages": [] + } +} diff --git a/tests/fixtures/responses/err_empty_state.json b/tests/fixtures/responses/err_empty_state.json new file mode 100644 index 0000000..5c17a5e --- /dev/null +++ b/tests/fixtures/responses/err_empty_state.json @@ -0,0 +1,28 @@ +{ + "status": 422, + "headers": { + "Content-Type": "application/json", + "cf-ai-req-id": "75750901-db6e-46fa-8f7b-cc2c92e4036e", + "CF-RAY": "a502a0d87fda1dd7-CDG" + }, + "request": { + "model": "clairic", + "state": "", + "fields": { + "total": { + "type": "number" + } + } + }, + "response": { + "errors": [ + { + "message": "AiError: AiError: Request body failed validation: state must be non-empty when no images are sent (75750901-db6e-46fa-8f7b-cc2c92e4036e)", + "code": 3030 + } + ], + "success": false, + "result": {}, + "messages": [] + } +} diff --git a/tests/fixtures/responses/err_estimate_min_ge_max.json b/tests/fixtures/responses/err_estimate_min_ge_max.json new file mode 100644 index 0000000..2f1e91e --- /dev/null +++ b/tests/fixtures/responses/err_estimate_min_ge_max.json @@ -0,0 +1,30 @@ +{ + "status": 422, + "headers": { + "Content-Type": "application/json", + "cf-ai-req-id": "c7156771-77ed-426d-9778-810255876bd6", + "CF-RAY": "a502a0cc5d6d556d-CDG" + }, + "request": { + "model": "clairic", + "state": "Total $10.", + "fields": { + "x": { + "type": "estimate", + "min": 10, + "max": 5 + } + } + }, + "response": { + "errors": [ + { + "message": "AiError: AiError: estimate x needs finite min < max, got 10 and 5 (c7156771-77ed-426d-9778-810255876bd6)", + "code": 3030 + } + ], + "success": false, + "result": {}, + "messages": [] + } +} diff --git a/tests/fixtures/responses/err_estimate_no_bounds.json b/tests/fixtures/responses/err_estimate_no_bounds.json new file mode 100644 index 0000000..cab168b --- /dev/null +++ b/tests/fixtures/responses/err_estimate_no_bounds.json @@ -0,0 +1,28 @@ +{ + "status": 422, + "headers": { + "Content-Type": "application/json", + "cf-ai-req-id": "1a8b591e-6585-4893-a189-3b341c5582f9", + "CF-RAY": "a502a0c69da12bd3-CDG" + }, + "request": { + "model": "clairic", + "state": "Total $10.", + "fields": { + "x": { + "type": "estimate" + } + } + }, + "response": { + "errors": [ + { + "message": "AiError: AiError: estimate x needs numeric min and max (1a8b591e-6585-4893-a189-3b341c5582f9)", + "code": 3030 + } + ], + "success": false, + "result": {}, + "messages": [] + } +} diff --git a/tests/fixtures/responses/err_horizon_65.json b/tests/fixtures/responses/err_horizon_65.json new file mode 100644 index 0000000..210845e --- /dev/null +++ b/tests/fixtures/responses/err_horizon_65.json @@ -0,0 +1,31 @@ +{ + "status": 400, + "headers": { + "Content-Type": "application/json", + "cf-ai-req-id": "058757e9-da46-40af-9275-2b3b74cd2cba", + "CF-RAY": "a502a0deda3d2a7b-CDG" + }, + "request": { + "model": "clairic", + "state": "Total $10.", + "fields": { + "x": { + "type": "forecast", + "horizon": 65, + "min": 0, + "max": 10 + } + } + }, + "response": { + "errors": [ + { + "message": "AiError: Bad input: Error: '/x/horizon' must be <= 64 (058757e9-da46-40af-9275-2b3b74cd2cba)", + "code": 5006 + } + ], + "success": false, + "result": {}, + "messages": [] + } +} diff --git a/tests/fixtures/responses/err_list_no_items.json b/tests/fixtures/responses/err_list_no_items.json new file mode 100644 index 0000000..aa7d827 --- /dev/null +++ b/tests/fixtures/responses/err_list_no_items.json @@ -0,0 +1,28 @@ +{ + "status": 422, + "headers": { + "Content-Type": "application/json", + "cf-ai-req-id": "50f75699-45fe-4727-8f55-cc3425c72572", + "CF-RAY": "a502a0c49eb1d6e2-CDG" + }, + "request": { + "model": "clairic", + "state": "Total $10.", + "fields": { + "x": { + "type": "list" + } + } + }, + "response": { + "errors": [ + { + "message": "AiError: AiError: list x needs items in ('text', 'number', 'date') (50f75699-45fe-4727-8f55-cc3425c72572)", + "code": 3030 + } + ], + "success": false, + "result": {}, + "messages": [] + } +} diff --git a/tests/fixtures/responses/err_malformed_json.json b/tests/fixtures/responses/err_malformed_json.json new file mode 100644 index 0000000..c10d250 --- /dev/null +++ b/tests/fixtures/responses/err_malformed_json.json @@ -0,0 +1,19 @@ +{ + "status": 400, + "headers": { + "Content-Type": "application/json", + "CF-RAY": "a502a0eacdab531b-CDG" + }, + "request": "", + "response": { + "errors": [ + { + "message": "Request body is not valid json", + "code": 6003 + } + ], + "success": false, + "result": {}, + "messages": [] + } +} diff --git a/tests/fixtures/responses/err_missing_fields.json b/tests/fixtures/responses/err_missing_fields.json new file mode 100644 index 0000000..f16dd9d --- /dev/null +++ b/tests/fixtures/responses/err_missing_fields.json @@ -0,0 +1,23 @@ +{ + "status": 400, + "headers": { + "Content-Type": "application/json", + "cf-ai-req-id": "8e29098e-63e5-4d92-aa90-ae5eb3a64c5c", + "CF-RAY": "a502a0bf2c9f701a-CDG" + }, + "request": { + "model": "clairic", + "state": "Total $10." + }, + "response": { + "errors": [ + { + "message": "AiError: Bad input: Error: required properties at '/' are 'model,fields' (8e29098e-63e5-4d92-aa90-ae5eb3a64c5c)", + "code": 5006 + } + ], + "success": false, + "result": {}, + "messages": [] + } +} diff --git a/tests/fixtures/responses/err_no_token.json b/tests/fixtures/responses/err_no_token.json new file mode 100644 index 0000000..a3fae13 --- /dev/null +++ b/tests/fixtures/responses/err_no_token.json @@ -0,0 +1,27 @@ +{ + "status": 401, + "headers": { + "Content-Type": "application/json", + "CF-RAY": "a502a0bcfb54f6a4-CDG" + }, + "request": { + "model": "clairic", + "state": "Total $10.", + "fields": { + "total": { + "type": "number" + } + } + }, + "response": { + "result": null, + "success": false, + "errors": [ + { + "code": 10000, + "message": "Authentication error" + } + ], + "messages": [] + } +} diff --git a/tests/fixtures/responses/err_null_threshold_zero.json b/tests/fixtures/responses/err_null_threshold_zero.json new file mode 100644 index 0000000..afb5b03 --- /dev/null +++ b/tests/fixtures/responses/err_null_threshold_zero.json @@ -0,0 +1,29 @@ +{ + "status": 400, + "headers": { + "Content-Type": "application/json", + "cf-ai-req-id": "767d41d3-0dec-4604-991b-0df9b5b98aa0", + "CF-RAY": "a502a0f08b6a2a5c-CDG" + }, + "request": { + "model": "clairic", + "state": "Total $10.", + "fields": { + "total": { + "type": "number", + "null_threshold": 0 + } + } + }, + "response": { + "errors": [ + { + "message": "AiError: Bad input: Error: '/total/null_threshold' must be > 0 (767d41d3-0dec-4604-991b-0df9b5b98aa0)", + "code": 5006 + } + ], + "success": false, + "result": {}, + "messages": [] + } +} diff --git a/tests/fixtures/responses/err_option_on_wrong_type.json b/tests/fixtures/responses/err_option_on_wrong_type.json new file mode 100644 index 0000000..851917f --- /dev/null +++ b/tests/fixtures/responses/err_option_on_wrong_type.json @@ -0,0 +1,30 @@ +{ + "status": 422, + "headers": { + "Content-Type": "application/json", + "cf-ai-req-id": "dd0edda8-a12e-45ea-914f-3776a8e27408", + "CF-RAY": "a502a0ef69971b44-CDG" + }, + "request": { + "model": "clairic", + "state": "Total $10.", + "fields": { + "total": { + "type": "text", + "decimals": 2, + "min": 0 + } + } + }, + "response": { + "errors": [ + { + "message": "AiError: AiError: field total: text fields don't take 'decimals' (dd0edda8-a12e-45ea-914f-3776a8e27408)", + "code": 3030 + } + ], + "success": false, + "result": {}, + "messages": [] + } +} diff --git a/tests/fixtures/responses/err_state_not_string.json b/tests/fixtures/responses/err_state_not_string.json new file mode 100644 index 0000000..7e3a092 --- /dev/null +++ b/tests/fixtures/responses/err_state_not_string.json @@ -0,0 +1,28 @@ +{ + "status": 400, + "headers": { + "Content-Type": "application/json", + "cf-ai-req-id": "ceb64541-0fd5-4569-82bb-39c52b2ce9c3", + "CF-RAY": "a502a0e95fe26eea-CDG" + }, + "request": { + "model": "clairic", + "state": 42, + "fields": { + "total": { + "type": "number" + } + } + }, + "response": { + "errors": [ + { + "message": "AiError: Bad input: Error: Type mismatch of '/state', 'string' not in 'number','integer' (ceb64541-0fd5-4569-82bb-39c52b2ce9c3)", + "code": 5006 + } + ], + "success": false, + "result": {}, + "messages": [] + } +} diff --git a/tests/fixtures/responses/err_unknown_field_key.json b/tests/fixtures/responses/err_unknown_field_key.json new file mode 100644 index 0000000..3f28bc2 --- /dev/null +++ b/tests/fixtures/responses/err_unknown_field_key.json @@ -0,0 +1,29 @@ +{ + "status": 422, + "headers": { + "Content-Type": "application/json", + "cf-ai-req-id": "58affb88-2ce0-420e-8162-ce0ee29dc31a", + "CF-RAY": "a502a0eb899a0274-CDG" + }, + "request": { + "model": "clairic", + "state": "Total $10.", + "fields": { + "total": { + "type": "number", + "colour": "blue" + } + } + }, + "response": { + "errors": [ + { + "message": "AiError: AiError: field total has unknown key 'colour'; number fields take type, instructions, unit, null_threshold, integer, decimals (58affb88-2ce0-420e-8162-ce0ee29dc31a)", + "code": 3030 + } + ], + "success": false, + "result": {}, + "messages": [] + } +} diff --git a/tests/fixtures/responses/err_unknown_option.json b/tests/fixtures/responses/err_unknown_option.json new file mode 100644 index 0000000..47a66dc --- /dev/null +++ b/tests/fixtures/responses/err_unknown_option.json @@ -0,0 +1,31 @@ +{ + "status": 422, + "headers": { + "Content-Type": "application/json", + "cf-ai-req-id": "9e213907-d8f9-4928-9da3-04c6803dcc7e", + "CF-RAY": "a502a0ee2c50d09a-CDG" + }, + "request": { + "model": "clairic", + "state": "Total $10.", + "fields": { + "total": { + "type": "number" + } + }, + "options": { + "verbose": true + } + }, + "response": { + "errors": [ + { + "message": "AiError: AiError: Request body failed validation: options.verbose: Extra inputs are not permitted (9e213907-d8f9-4928-9da3-04c6803dcc7e)", + "code": 3030 + } + ], + "success": false, + "result": {}, + "messages": [] + } +} diff --git a/tests/fixtures/responses/err_unknown_top_key.json b/tests/fixtures/responses/err_unknown_top_key.json new file mode 100644 index 0000000..667ba3d --- /dev/null +++ b/tests/fixtures/responses/err_unknown_top_key.json @@ -0,0 +1,29 @@ +{ + "status": 422, + "headers": { + "Content-Type": "application/json", + "cf-ai-req-id": "6308fa89-d642-4147-a93c-07a43ee5f576", + "CF-RAY": "a502a0ed0fb9c799-CDG" + }, + "request": { + "model": "clairic", + "state": "Total $10.", + "fields": { + "total": { + "type": "number" + } + }, + "temperature": 0.2 + }, + "response": { + "errors": [ + { + "message": "AiError: AiError: Request body failed validation: temperature: Extra inputs are not permitted (6308fa89-d642-4147-a93c-07a43ee5f576)", + "code": 3030 + } + ], + "success": false, + "result": {}, + "messages": [] + } +} diff --git a/tests/fixtures/responses/err_wrong_model.json b/tests/fixtures/responses/err_wrong_model.json new file mode 100644 index 0000000..ee2ce3a --- /dev/null +++ b/tests/fixtures/responses/err_wrong_model.json @@ -0,0 +1,28 @@ +{ + "status": 400, + "headers": { + "Content-Type": "application/json", + "cf-ai-req-id": "db4bf529-aa90-428e-b379-9eefc869e05c", + "CF-RAY": "a502a0c29aa3d15e-CDG" + }, + "request": { + "model": "gpt", + "state": "Total $10.", + "fields": { + "total": { + "type": "number" + } + } + }, + "response": { + "errors": [ + { + "message": "AiError: Bad input: Error: '/model' failed test ^(clairic|@cf/cloudflare/clairic)$ patttern (db4bf529-aa90-428e-b379-9eefc869e05c)", + "code": 5006 + } + ], + "success": false, + "result": {}, + "messages": [] + } +} diff --git a/tests/fixtures/responses/estimate_no_quantiles.json b/tests/fixtures/responses/estimate_no_quantiles.json new file mode 100644 index 0000000..6dbb297 --- /dev/null +++ b/tests/fixtures/responses/estimate_no_quantiles.json @@ -0,0 +1,52 @@ +{ + "status": 200, + "headers": { + "Content-Type": "application/json", + "cf-ai-req-id": "2e6ccd1e-66f1-458d-9d9e-5bb999a94f5d", + "CF-RAY": "a5029f427d6b154c-CDG" + }, + "request": { + "model": "clairic", + "state": "Comparable sales, same street, 2025: 12 Oak St, 3 bed 2 bath 1,650 sqft, sold $402,000. 18 Oak St, 3 bed 2 bath 1,720 sqft, sold $431,000. 25 Oak St, 4 bed 3 bath 2,100 sqft, sold $515,000. Subject: 21 Oak St, 3 bed 2 bath 1,700 sqft, renovated kitchen. Listed 2026-04-01.", + "fields": { + "price_log": { + "type": "estimate", + "unit": "USD", + "min": 50000, + "max": 5000000, + "step": 1000, + "scale": "log", + "instructions": "Likely sale price of the subject" + } + } + }, + "response": { + "result": { + "model": "clairic", + "answers": { + "price_log": { + "type": "estimate", + "value": 450000, + "mean": 450407.7584891305, + "median": 450000, + "p10": 392000, + "p90": 508000, + "p_below": 2.205319560744101e-06, + "p_above": 1.6444121229142183e-06 + } + }, + "truncated": false, + "usage": { + "state_tokens": 144, + "image_tokens": 0, + "schema_tokens": 178, + "input_tokens": 322, + "output_tokens": 0, + "passes": 1 + } + }, + "success": true, + "errors": [], + "messages": [] + } +} diff --git a/tests/fixtures/responses/estimate_quantiles.json b/tests/fixtures/responses/estimate_quantiles.json new file mode 100644 index 0000000..4add54e --- /dev/null +++ b/tests/fixtures/responses/estimate_quantiles.json @@ -0,0 +1,743 @@ +{ + "status": 200, + "headers": { + "Content-Type": "application/json", + "cf-ai-req-id": "33cf5c3d-049a-4586-b57b-9b0e7e84e12d", + "CF-RAY": "a5029f407a116f1d-CDG" + }, + "request": { + "model": "clairic", + "state": "Comparable sales, same street, 2025: 12 Oak St, 3 bed 2 bath 1,650 sqft, sold $402,000. 18 Oak St, 3 bed 2 bath 1,720 sqft, sold $431,000. 25 Oak St, 4 bed 3 bath 2,100 sqft, sold $515,000. Subject: 21 Oak St, 3 bed 2 bath 1,700 sqft, renovated kitchen. Listed 2026-04-01.", + "fields": { + "price_log": { + "type": "estimate", + "unit": "USD", + "min": 50000, + "max": 5000000, + "step": 1000, + "scale": "log", + "instructions": "Likely sale price of the subject" + }, + "price_linear": { + "type": "estimate", + "unit": "USD", + "min": 50000, + "max": 5000000, + "step": 1000, + "instructions": "Likely sale price of the subject" + }, + "days_on_market": { + "type": "estimate", + "min": 0, + "max": 365, + "step": 1, + "instructions": "Days until the subject sells" + }, + "sale_date": { + "type": "estimate", + "min": "2026-04-01", + "max": "2027-04-01", + "step": 1, + "instructions": "Date the subject sells" + }, + "sale_month": { + "type": "estimate", + "min": "2026-04-01", + "max": "2027-04-01", + "step": "month", + "instructions": "Month the subject sells" + }, + "unknowable": { + "type": "estimate", + "min": 0, + "max": 100, + "step": 1, + "instructions": "Age of the seller's dog in years" + } + }, + "options": { + "include_quantiles": true + } + }, + "response": { + "result": { + "model": "clairic", + "answers": { + "price_log": { + "type": "estimate", + "value": 442000, + "mean": 441836.93742931326, + "median": 442000, + "p10": 375000, + "p90": 498000, + "quantiles": [ + 315000, + 329000, + 337000, + 344000, + 351000, + 357000, + 362000, + 366000, + 371000, + 375000, + 379000, + 382000, + 385000, + 388000, + 391000, + 394000, + 396000, + 398000, + 400000, + 402000, + 404000, + 405000, + 406000, + 408000, + 409000, + 410000, + 412000, + 413000, + 415000, + 416000, + 417000, + 419000, + 420000, + 421000, + 423000, + 424000, + 425000, + 426000, + 428000, + 429000, + 430000, + 432000, + 433000, + 434000, + 436000, + 437000, + 438000, + 440000, + 441000, + 442000, + 444000, + 445000, + 446000, + 448000, + 449000, + 450000, + 451000, + 453000, + 454000, + 455000, + 456000, + 457000, + 459000, + 460000, + 461000, + 462000, + 463000, + 465000, + 466000, + 467000, + 469000, + 470000, + 471000, + 473000, + 474000, + 476000, + 477000, + 479000, + 480000, + 482000, + 483000, + 485000, + 486000, + 488000, + 489000, + 491000, + 493000, + 495000, + 497000, + 498000, + 501000, + 509000, + 518000, + 529000, + 541000, + 552000, + 563000, + 575000, + 588000 + ], + "p_below": 2.2824776806373848e-06, + "p_above": 9.232163051819953e-07 + }, + "price_linear": { + "type": "estimate", + "value": 530000, + "mean": 530234.9845917388, + "median": 463000, + "p10": 409000, + "p90": 612000, + "quantiles": [ + 329000, + 355000, + 382000, + 399000, + 401000, + 402000, + 404000, + 406000, + 408000, + 409000, + 411000, + 413000, + 415000, + 416000, + 418000, + 419000, + 421000, + 422000, + 423000, + 425000, + 426000, + 428000, + 429000, + 430000, + 432000, + 433000, + 434000, + 436000, + 437000, + 438000, + 440000, + 441000, + 442000, + 443000, + 445000, + 446000, + 447000, + 448000, + 450000, + 451000, + 452000, + 453000, + 455000, + 456000, + 457000, + 458000, + 460000, + 461000, + 462000, + 463000, + 465000, + 466000, + 467000, + 468000, + 470000, + 471000, + 472000, + 473000, + 474000, + 476000, + 477000, + 478000, + 480000, + 481000, + 483000, + 484000, + 485000, + 487000, + 488000, + 489000, + 491000, + 492000, + 493000, + 495000, + 499000, + 503000, + 507000, + 510000, + 514000, + 523000, + 531000, + 539000, + 546000, + 554000, + 561000, + 568000, + 576000, + 584000, + 592000, + 612000, + 875000, + 966000, + 1021000, + 1071000, + 1142000, + 1215000, + 1274000, + 1325000, + 1424000 + ], + "p_below": 6.949440489734116e-07, + "p_above": 4.774552053277148e-06 + }, + "days_on_market": { + "type": "estimate", + "value": 61, + "mean": 61.242333457270234, + "median": 57, + "p10": 20, + "p90": 105, + "quantiles": [ + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 19, + 20, + 21, + 21, + 22, + 22, + 23, + 24, + 24, + 25, + 26, + 26, + 27, + 28, + 29, + 30, + 30, + 31, + 32, + 32, + 33, + 34, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 47, + 48, + 49, + 51, + 53, + 54, + 55, + 57, + 58, + 59, + 61, + 63, + 64, + 65, + 67, + 68, + 69, + 71, + 73, + 74, + 75, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97, + 98, + 99, + 100, + 101, + 102, + 103, + 105, + 106, + 109, + 111, + 114, + 117, + 122, + 128, + 137, + 158 + ], + "p_below": 2.7900690838578157e-05, + "p_above": 4.722927405964583e-05 + }, + "sale_date": { + "type": "estimate", + "value": "2026-06-01", + "mean": "2026-06-01", + "median": "2026-05-24", + "p10": "2026-04-19", + "p90": "2026-07-19", + "quantiles": [ + "2026-04-05", + "2026-04-08", + "2026-04-10", + "2026-04-12", + "2026-04-14", + "2026-04-15", + "2026-04-16", + "2026-04-17", + "2026-04-18", + "2026-04-19", + "2026-04-21", + "2026-04-22", + "2026-04-23", + "2026-04-24", + "2026-04-25", + "2026-04-26", + "2026-04-27", + "2026-04-28", + "2026-04-29", + "2026-04-30", + "2026-04-30", + "2026-05-01", + "2026-05-02", + "2026-05-03", + "2026-05-04", + "2026-05-05", + "2026-05-06", + "2026-05-07", + "2026-05-08", + "2026-05-09", + "2026-05-10", + "2026-05-11", + "2026-05-11", + "2026-05-12", + "2026-05-13", + "2026-05-14", + "2026-05-14", + "2026-05-15", + "2026-05-15", + "2026-05-16", + "2026-05-16", + "2026-05-17", + "2026-05-18", + "2026-05-19", + "2026-05-19", + "2026-05-20", + "2026-05-21", + "2026-05-22", + "2026-05-24", + "2026-05-24", + "2026-05-25", + "2026-05-26", + "2026-05-27", + "2026-05-28", + "2026-05-29", + "2026-05-30", + "2026-05-31", + "2026-06-01", + "2026-06-02", + "2026-06-03", + "2026-06-04", + "2026-06-05", + "2026-06-06", + "2026-06-07", + "2026-06-08", + "2026-06-09", + "2026-06-10", + "2026-06-11", + "2026-06-12", + "2026-06-13", + "2026-06-15", + "2026-06-16", + "2026-06-18", + "2026-06-19", + "2026-06-20", + "2026-06-22", + "2026-06-23", + "2026-06-25", + "2026-06-27", + "2026-06-28", + "2026-06-30", + "2026-07-01", + "2026-07-02", + "2026-07-04", + "2026-07-06", + "2026-07-08", + "2026-07-10", + "2026-07-13", + "2026-07-16", + "2026-07-19", + "2026-07-22", + "2026-07-26", + "2026-07-30", + "2026-08-04", + "2026-08-14", + "2026-08-25", + "2026-09-07", + "2026-09-20", + "2026-10-13" + ] + }, + "sale_month": { + "type": "estimate", + "value": "2026-06-01", + "mean": "2026-06-01", + "median": "2026-06-01", + "p10": "2026-05-01", + "p90": "2026-08-01", + "quantiles": [ + "2026-04-01", + "2026-04-01", + "2026-04-01", + "2026-05-01", + "2026-05-01", + "2026-05-01", + "2026-05-01", + "2026-05-01", + "2026-05-01", + "2026-05-01", + "2026-05-01", + "2026-05-01", + "2026-05-01", + "2026-05-01", + "2026-05-01", + "2026-05-01", + "2026-05-01", + "2026-05-01", + "2026-05-01", + "2026-05-01", + "2026-05-01", + "2026-05-01", + "2026-05-01", + "2026-05-01", + "2026-06-01", + "2026-06-01", + "2026-06-01", + "2026-06-01", + "2026-06-01", + "2026-06-01", + "2026-06-01", + "2026-06-01", + "2026-06-01", + "2026-06-01", + "2026-06-01", + "2026-06-01", + "2026-06-01", + "2026-06-01", + "2026-06-01", + "2026-06-01", + "2026-06-01", + "2026-06-01", + "2026-06-01", + "2026-06-01", + "2026-06-01", + "2026-06-01", + "2026-06-01", + "2026-06-01", + "2026-06-01", + "2026-06-01", + "2026-06-01", + "2026-06-01", + "2026-06-01", + "2026-06-01", + "2026-06-01", + "2026-07-01", + "2026-07-01", + "2026-07-01", + "2026-07-01", + "2026-07-01", + "2026-07-01", + "2026-07-01", + "2026-07-01", + "2026-07-01", + "2026-07-01", + "2026-07-01", + "2026-07-01", + "2026-07-01", + "2026-07-01", + "2026-07-01", + "2026-07-01", + "2026-07-01", + "2026-07-01", + "2026-07-01", + "2026-07-01", + "2026-07-01", + "2026-07-01", + "2026-07-01", + "2026-07-01", + "2026-07-01", + "2026-08-01", + "2026-08-01", + "2026-08-01", + "2026-08-01", + "2026-08-01", + "2026-08-01", + "2026-08-01", + "2026-08-01", + "2026-08-01", + "2026-08-01", + "2026-08-01", + "2026-08-01", + "2026-08-01", + "2026-09-01", + "2026-09-01", + "2026-09-01", + "2026-10-01", + "2026-10-01", + "2026-11-01" + ] + }, + "unknowable": { + "type": "estimate", + "value": 3, + "mean": 3.176274072943677, + "median": 1, + "p10": 0, + "p90": 10, + "quantiles": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 2, + 2, + 2, + 2, + 2, + 3, + 3, + 3, + 4, + 4, + 4, + 5, + 5, + 5, + 6, + 6, + 7, + 7, + 8, + 8, + 9, + 10, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 19, + 29 + ], + "p_below": 3.079798989347182e-05, + "p_above": 1.3668101928487886e-05 + } + }, + "truncated": false, + "usage": { + "state_tokens": 144, + "image_tokens": 0, + "schema_tokens": 535, + "input_tokens": 679, + "output_tokens": 0, + "passes": 1 + } + }, + "success": true, + "errors": [], + "messages": [] + } +} diff --git a/tests/fixtures/responses/estimate_step_year.json b/tests/fixtures/responses/estimate_step_year.json new file mode 100644 index 0000000..19ecfd8 --- /dev/null +++ b/tests/fixtures/responses/estimate_step_year.json @@ -0,0 +1,49 @@ +{ + "status": 200, + "headers": { + "Content-Type": "application/json", + "cf-ai-req-id": "6993632d-a208-41f2-a8e7-142763dc4131", + "CF-RAY": "a502a181ce85d913-CDG" + }, + "request": { + "model": "clairic", + "state": "Founded in 1998, the firm grew steadily.", + "fields": { + "next_ipo": { + "type": "estimate", + "min": "2026-01-01", + "max": "2040-01-01", + "step": "year", + "instructions": "Year of a likely IPO" + } + }, + "reference_date": "2026-10-25" + }, + "response": { + "result": { + "model": "clairic", + "answers": { + "next_ipo": { + "type": "estimate", + "value": "2029-01-01", + "mean": "2029-01-01", + "median": "2029-01-01", + "p10": "2027-01-01", + "p90": "2034-01-01" + } + }, + "truncated": false, + "usage": { + "state_tokens": 13, + "image_tokens": 0, + "schema_tokens": 195, + "input_tokens": 208, + "output_tokens": 0, + "passes": 1 + } + }, + "success": true, + "errors": [], + "messages": [] + } +} diff --git a/tests/fixtures/responses/forecast_no_interval.json b/tests/fixtures/responses/forecast_no_interval.json new file mode 100644 index 0000000..0e9f67f --- /dev/null +++ b/tests/fixtures/responses/forecast_no_interval.json @@ -0,0 +1,92 @@ +{ + "status": 200, + "headers": { + "Content-Type": "application/json", + "cf-ai-req-id": "8b3e750a-ab0c-42b2-a028-e89c01206260", + "CF-RAY": "a5029f458e12571a-CDG" + }, + "request": { + "model": "clairic", + "state": "date,weekday,visitors\n2026-09-01,Tue,1010\n2026-09-02,Wed,1020\n2026-09-03,Thu,1030\n2026-09-04,Fri,1190\n2026-09-05,Sat,1200\n2026-09-06,Sun,1060\n2026-09-07,Mon,1070\n2026-09-08,Tue,1080\n2026-09-09,Wed,1090\n2026-09-10,Thu,1100\n2026-09-11,Fri,1260\n2026-09-12,Sat,1270\n2026-09-13,Sun,1130\n2026-09-14,Mon,1140\n2026-09-15,Tue,1150\n2026-09-16,Wed,1160\n2026-09-17,Thu,1170\n2026-09-18,Fri,1330\n2026-09-19,Sat,1340\n2026-09-20,Sun,1200\n2026-09-21,Mon,1210\n2026-09-22,Tue,1220\n2026-09-23,Wed,1230\n2026-09-24,Thu,1240\n2026-09-25,Fri,1400\n2026-09-26,Sat,1410\n2026-09-27,Sun,1270\n2026-09-28,Mon,1280\nForecast from: 2026-09-29 (Tue)", + "fields": { + "next": { + "type": "forecast", + "horizon": 3, + "min": 0, + "max": 5000, + "instructions": "Visitors for the next steps" + } + } + }, + "response": { + "result": { + "model": "clairic", + "answers": { + "next": { + "type": "forecast", + "value": [ + 1274.844469095917, + 1320.5199792308067, + 1336.09459076095 + ], + "median": [ + 1271.368329888199, + 1326.217587881885, + 1338.4091562323413 + ], + "p10": [ + 1210.4377165334372, + 1230.658226665473, + 1278.0888273964513 + ], + "p90": [ + 1362.5484613460803, + 1387.1089466631925, + 1390.010401300968 + ], + "steps": [ + { + "value": 1274.844469095917, + "mean": 1274.844469095917, + "median": 1271.368329888199, + "p10": 1210.4377165334372, + "p90": 1362.5484613460803, + "p_below": 4.3809129124383617e-07, + "p_above": 3.87025920645101e-07 + }, + { + "value": 1320.5199792308067, + "mean": 1320.5199792308067, + "median": 1326.217587881885, + "p10": 1230.658226665473, + "p90": 1387.1089466631925, + "p_below": 3.842155535949132e-07, + "p_above": 3.019754331035074e-07 + }, + { + "value": 1336.09459076095, + "mean": 1336.09459076095, + "median": 1338.4091562323413, + "p10": 1278.0888273964513, + "p90": 1390.010401300968, + "p_below": 4.625202905117476e-07, + "p_above": 3.0102020787126094e-07 + } + ] + } + }, + "truncated": false, + "usage": { + "state_tokens": 528, + "image_tokens": 0, + "schema_tokens": 306, + "input_tokens": 834, + "output_tokens": 0, + "passes": 1 + } + }, + "success": true, + "errors": [], + "messages": [] + } +} diff --git a/tests/fixtures/responses/forecast_ok.json b/tests/fixtures/responses/forecast_ok.json new file mode 100644 index 0000000..83aa555 --- /dev/null +++ b/tests/fixtures/responses/forecast_ok.json @@ -0,0 +1,649 @@ +{ + "status": 200, + "headers": { + "Content-Type": "application/json", + "cf-ai-req-id": "cb108346-9d9a-4230-b129-ff4d58bf8f13", + "CF-RAY": "a5029f97acd9d08b-CDG" + }, + "request": { + "model": "clairic", + "state": "date,weekday,visitors\n2026-09-01,Tue,1010\n2026-09-02,Wed,1020\n2026-09-03,Thu,1030\n2026-09-04,Fri,1190\n2026-09-05,Sat,1200\n2026-09-06,Sun,1060\n2026-09-07,Mon,1070\n2026-09-08,Tue,1080\n2026-09-09,Wed,1090\n2026-09-10,Thu,1100\n2026-09-11,Fri,1260\n2026-09-12,Sat,1270\n2026-09-13,Sun,1130\n2026-09-14,Mon,1140\n2026-09-15,Tue,1150\n2026-09-16,Wed,1160\n2026-09-17,Thu,1170\n2026-09-18,Fri,1330\n2026-09-19,Sat,1340\n2026-09-20,Sun,1200\n2026-09-21,Mon,1210\n2026-09-22,Tue,1220\n2026-09-23,Wed,1230\n2026-09-24,Thu,1240\n2026-09-25,Fri,1400\n2026-09-26,Sat,1410\n2026-09-27,Sun,1270\n2026-09-28,Mon,1280\nForecast from: 2026-09-29 (Tue)", + "fields": { + "next_day": { + "type": "forecast", + "horizon": 1, + "interval": "day", + "min": 0, + "max": 5000, + "instructions": "Visitors tomorrow" + }, + "next_days": { + "type": "forecast", + "horizon": 4, + "interval": "day", + "min": 100, + "max": 5000, + "scale": "log", + "instructions": "Visitors on each of the next 4 days" + } + }, + "options": { + "include_quantiles": true + } + }, + "response": { + "result": { + "model": "clairic", + "answers": { + "next_day": { + "type": "forecast", + "value": [ + 1276.5413866583615 + ], + "median": [ + 1270.8862522202319 + ], + "p10": [ + 1211.8222471005465 + ], + "p90": [ + 1364.3850335993718 + ], + "steps": [ + { + "value": 1276.5413866583615, + "mean": 1276.5413866583615, + "median": 1270.8862522202319, + "p10": 1211.8222471005465, + "p90": 1364.3850335993718, + "quantiles": [ + 1193.316345169709, + 1195.4131799605418, + 1197.5100147513747, + 1199.6068495422076, + 1201.7036843330402, + 1203.8005191238733, + 1205.8973539147062, + 1207.9941887055388, + 1210.0910234963717, + 1211.8222471005465, + 1213.3059558153998, + 1214.7896645302526, + 1216.2733732451056, + 1217.7570819599587, + 1219.2407906748117, + 1220.7244993896647, + 1222.2082081045178, + 1223.6919168193708, + 1225.1756255342236, + 1226.659334249077, + 1228.1430429639297, + 1229.626751678783, + 1231.1651916738792, + 1232.7754454443793, + 1234.3856992148797, + 1235.99595298538, + 1237.60620675588, + 1239.2164605263804, + 1240.8267142968807, + 1242.436968067381, + 1244.0472218378811, + 1245.6574756083814, + 1247.2677293788818, + 1248.877983149382, + 1250.418223424783, + 1251.7975725254837, + 1253.1769216261844, + 1254.556270726885, + 1255.9356198275857, + 1257.3149689282861, + 1258.694318028987, + 1260.0736671296875, + 1261.4530162303881, + 1262.8323653310888, + 1264.2117144317895, + 1265.59106353249, + 1266.9704126331908, + 1268.3497617338912, + 1269.7012364424131, + 1270.8862522202319, + 1272.0712679980509, + 1273.2562837758699, + 1274.4412995536889, + 1275.6263153315078, + 1276.8113311093268, + 1277.9963468871458, + 1279.1813626649646, + 1280.3663784427836, + 1281.5513942206026, + 1282.7364099984215, + 1283.9214257762405, + 1285.1064415540595, + 1286.291457331878, + 1287.476473109697, + 1288.661488887516, + 1290.146655084953, + 1291.7853491281153, + 1293.4240431712778, + 1295.0627372144402, + 1296.7014312576025, + 1298.3401253007648, + 1299.9788193439274, + 1301.6175133870897, + 1303.256207430252, + 1304.8949014734144, + 1306.533595516577, + 1308.1722895597393, + 1311.7401494837725, + 1315.9759682350555, + 1320.2117869863387, + 1324.4476057376216, + 1328.7444496847595, + 1333.4431497380838, + 1338.141849791408, + 1342.8405498447323, + 1347.5392498980566, + 1351.7598595868753, + 1355.9682509243742, + 1360.176642261873, + 1364.3850335993718, + 1368.395305163769, + 1372.0106715743361, + 1375.6260379849034, + 1379.2414043954705, + 1382.8567708060377, + 1386.4721372166048, + 1391.4845906826345, + 1396.5993355819426, + 1401.7140804812507 + ], + "p_below": 6.453300898101588e-07, + "p_above": 4.791045853380638e-07 + } + ] + }, + "next_days": { + "type": "forecast", + "value": [ + 1272.4742616231053, + 1315.9679391884656, + 1371.2053372717774, + 1493.7517682235464 + ], + "median": [ + 1273.3316315479155, + 1327.0007994168618, + 1370.7426983644716, + 1497.4402502611442 + ], + "p10": [ + 1208.6899546909303, + 1227.1720482129274, + 1300.4762999733598, + 1413.6428911363537 + ], + "p90": [ + 1370.0513601410603, + 1386.8278638391077, + 1473.8145458171855, + 1583.1579833158999 + ], + "steps": [ + { + "value": 1272.4742616231053, + "mean": 1274.1490575035514, + "median": 1273.3316315479155, + "p10": 1208.6899546909303, + "p90": 1370.0513601410603, + "quantiles": [ + 1066.3764301808203, + 1125.153128652935, + 1189.4062796740977, + 1192.3758840605042, + 1195.3529026924568, + 1198.3373540811895, + 1201.3292567841493, + 1204.3286294051195, + 1207.2458947650782, + 1208.6899546909303, + 1210.1357419443113, + 1211.5832585913834, + 1213.03250670078, + 1214.4834883436063, + 1215.9362055934482, + 1217.3906605263685, + 1218.8468552209174, + 1220.3047917581268, + 1221.7644722215214, + 1223.225898697118, + 1224.6890732734255, + 1226.213824998605, + 1227.8990396200502, + 1229.5865702717515, + 1231.2764201366872, + 1232.9685924022021, + 1234.66309026003, + 1236.359916906286, + 1238.0590755414778, + 1239.7605693705161, + 1241.4644016027091, + 1243.1705754517823, + 1244.8867042760826, + 1246.649302939117, + 1248.414397214028, + 1250.1819906342837, + 1251.9520867383478, + 1253.7246890696981, + 1255.4998011768284, + 1257.277426613257, + 1259.057568937533, + 1260.8402317132447, + 1262.6254185090252, + 1264.3122172850008, + 1265.811004102897, + 1267.3115676669904, + 1268.8139100835372, + 1270.3180334612887, + 1271.8239399114966, + 1273.3316315479155, + 1274.8411104868055, + 1276.3523788469367, + 1277.865438749586, + 1279.3802923185533, + 1280.896941680148, + 1282.4153889632055, + 1283.83764984124, + 1285.1408914042722, + 1286.4454559060525, + 1287.7513446895134, + 1289.0585590989515, + 1290.3671004800285, + 1291.6769701797718, + 1292.9881695465763, + 1294.3006999302042, + 1295.6145626817909, + 1296.9297591538427, + 1298.2462907002366, + 1299.5641586762256, + 1300.8833644384379, + 1302.2039093448777, + 1304.2383638912554, + 1307.4068358093198, + 1310.5830051043156, + 1313.7668904759867, + 1316.9585106695042, + 1320.1578844755795, + 1323.4202668331357, + 1327.2563683669102, + 1331.1035893276319, + 1334.961961946369, + 1338.8315185476185, + 1342.7122915495736, + 1346.737535665226, + 1350.806288407075, + 1354.8873336323782, + 1358.9807084790891, + 1363.0864501973615, + 1366.6584413045105, + 1370.0513601410603, + 1373.452702368476, + 1376.8624888989907, + 1380.2807406967602, + 1383.7074787779773, + 1387.3800512229673, + 1391.2339779060699, + 1395.0986101999833, + 1398.9739778432397, + 1402.8601106569704 + ], + "p_below": 6.403806818155999e-09, + "p_above": 1.0401410577287606e-07 + }, + { + "value": 1315.9679391884656, + "mean": 1317.4098731313873, + "median": 1327.0007994168618, + "p10": 1227.1720482129274, + "p90": 1386.8278638391077, + "quantiles": [ + 1132.0929079651376, + 1188.9886797962126, + 1196.6241575097304, + 1204.3086689280294, + 1209.3755510939557, + 1212.8944896755897, + 1216.4236673667638, + 1219.9631139603707, + 1223.5128593359923, + 1227.1720482129274, + 1231.0109896120102, + 1234.861940306031, + 1238.7249378634617, + 1242.6000199702996, + 1246.8770956392582, + 1251.5960316981382, + 1256.33282706136, + 1261.0875493193173, + 1265.9816516181068, + 1271.0545035497817, + 1276.1476826534088, + 1281.2612703809848, + 1285.0083419824364, + 1287.8833082697101, + 1290.7647067573696, + 1293.6525518362635, + 1296.5468579294352, + 1299.447639492197, + 1302.3549110122044, + 1303.8875103141065, + 1305.0175596481376, + 1306.148588369951, + 1307.28059732836, + 1308.4135873729128, + 1309.5475593538945, + 1310.6825141223264, + 1311.8184525299669, + 1312.955375429317, + 1314.0932836736094, + 1315.23217811682, + 1316.3720596136684, + 1317.5129290196076, + 1318.6547871908356, + 1319.7976349842963, + 1320.9414732576677, + 1322.0863028693796, + 1323.2459814428546, + 1324.49640545236, + 1325.7480110715014, + 1327.0007994168618, + 1328.2547716060799, + 1329.509928757847, + 1330.7662719919163, + 1332.0238024290938, + 1333.2825211912505, + 1334.5424294013114, + 1335.8035281832676, + 1337.065818662171, + 1338.3293019641355, + 1339.593979216338, + 1340.859851547024, + 1342.1269200855043, + 1343.3951859621545, + 1344.9419052860842, + 1346.5035048784014, + 1348.0669176295464, + 1349.6321456447597, + 1351.1991910317279, + 1352.7680559005844, + 1354.3387423639115, + 1355.911252536748, + 1357.485588536585, + 1359.0617524833735, + 1360.6397464995257, + 1362.2195727099167, + 1363.8012332418941, + 1365.4037902327373, + 1367.0134162589193, + 1368.624939816045, + 1370.2383631410487, + 1371.8536884734976, + 1373.4709180556013, + 1375.0900541322117, + 1376.7110989508265, + 1378.3340547615971, + 1379.9589238173198, + 1381.5857083734534, + 1383.2144106881155, + 1384.8450330220792, + 1386.8278638391077, + 1388.8927919469916, + 1390.9607946456026, + 1393.031876512877, + 1395.1060421335678, + 1397.1832960992513, + 1399.2636430083437, + 1401.3470874661086, + 1403.4336340846623, + 1405.5232874829928 + ], + "p_below": 4.590539059989851e-09, + "p_above": 5.434087313460623e-08 + }, + { + "value": 1371.2053372717774, + "mean": 1373.1435989060224, + "median": 1370.7426983644716, + "p10": 1300.4762999733598, + "p90": 1473.8145458171855, + "quantiles": [ + 1174.0033993843901, + 1207.6162412389674, + 1224.724011322806, + 1240.0773069818013, + 1254.9783216973572, + 1270.5918985214023, + 1284.5739854738977, + 1289.853032639484, + 1295.1537744207885, + 1300.4762999733598, + 1303.8150114637576, + 1305.3431836982945, + 1306.8731470691207, + 1308.4049036755819, + 1309.9384556194916, + 1311.4738050051244, + 1313.0109539392215, + 1314.5499045309932, + 1316.0906588921227, + 1317.6332191367653, + 1319.1775873815589, + 1320.7237657456174, + 1322.2717563505419, + 1323.9250366125518, + 1325.6929914815341, + 1327.463307257916, + 1329.2359870944322, + 1331.01103414802, + 1332.7884515798335, + 1334.568242555251, + 1336.3504102438776, + 1338.1349578195461, + 1339.9218884603365, + 1341.711205348565, + 1343.5053697697979, + 1345.3867593254154, + 1347.270783501438, + 1349.1574459872772, + 1351.0467504775147, + 1352.9387006719055, + 1354.8333002753825, + 1356.73055299807, + 1358.630462555288, + 1360.5330326675557, + 1362.4382670606062, + 1364.3131342361569, + 1365.9176923854827, + 1367.5241376432664, + 1369.1324722289214, + 1370.7426983644716, + 1372.3548182745546, + 1373.9688341864237, + 1375.5847483299508, + 1377.2025629376337, + 1378.822280244593, + 1380.4439024885771, + 1382.06743190997, + 1383.6928707517875, + 1385.3317469495637, + 1387.068712095391, + 1388.8078550935086, + 1390.5491786745658, + 1392.2926855726307, + 1394.0383785252084, + 1395.7862602732284, + 1397.5363335610584, + 1399.2886011365097, + 1401.0430657508384, + 1402.7997301587461, + 1404.558597118396, + 1406.3196693914012, + 1409.4950576146234, + 1412.814683410766, + 1416.1421275496316, + 1419.4774084448864, + 1422.820544553565, + 1426.1715543761713, + 1429.6919570469834, + 1433.4486122157575, + 1437.215138362672, + 1440.9915614246877, + 1444.7779074069126, + 1448.5742023827909, + 1452.2604009460906, + 1455.8731514769606, + 1459.4948893536182, + 1463.1256369336522, + 1466.7654166302661, + 1470.4142509124244, + 1473.8145458171855, + 1476.8967072173305, + 1479.9853142852317, + 1483.0803805005946, + 1486.1819193713193, + 1489.2899444335496, + 1492.4044692517384, + 1496.7012376773994, + 1509.1308912379216, + 1536.2837541210267 + ], + "p_below": 1.6175995654066355e-08, + "p_above": 1.449280517817897e-07 + }, + { + "value": 1493.7517682235464, + "mean": 1495.4374114959742, + "median": 1497.4402502611442, + "p10": 1413.6428911363537, + "p90": 1583.1579833158999, + "quantiles": [ + 1278.2693060864856, + 1329.1146589235755, + 1385.4985028241317, + 1391.3227153081605, + 1397.171411002378, + 1403.0446928267172, + 1407.349519882493, + 1409.4441910864775, + 1411.541979957673, + 1413.6428911363537, + 1415.7469292697008, + 1417.8540990118115, + 1419.9644050237105, + 1422.0778519733597, + 1424.1944445356687, + 1426.3141873925053, + 1428.4639217673089, + 1430.77782572283, + 1433.0954778664818, + 1435.4168842697825, + 1437.7420510140894, + 1440.0709841906069, + 1442.4036899004082, + 1444.7401742544484, + 1447.0804433735814, + 1449.4245033885788, + 1451.642040345936, + 1453.807492593626, + 1455.9761751028461, + 1458.1480926922595, + 1460.323250187722, + 1462.5016524222847, + 1464.6833042362077, + 1466.8682104769764, + 1469.056375999301, + 1471.2478056651396, + 1473.2795126436947, + 1475.11456114273, + 1476.9518952929027, + 1478.7915179411148, + 1480.633431937812, + 1482.4776401369902, + 1484.3241453962028, + 1486.172950576562, + 1488.0240585427416, + 1489.8774721629836, + 1491.7331943091058, + 1493.591227856498, + 1495.4701983271696, + 1497.4402502611442, + 1499.4128974354824, + 1501.3881432690148, + 1503.3659911850752, + 1505.3464446115088, + 1507.329506980673, + 1509.315181729447, + 1511.3034722992409, + 1513.2943821359963, + 1515.2879146901944, + 1517.2840734168633, + 1519.41316959571, + 1521.6453644169835, + 1523.8808385922996, + 1526.1195969394098, + 1528.361644283146, + 1530.6069854554287, + 1532.8556252952726, + 1535.107568648807, + 1537.3628203692758, + 1539.6213853170573, + 1541.8991483250418, + 1544.2659759322203, + 1546.6364366388336, + 1549.0105360217144, + 1551.3882796662656, + 1553.7696731664528, + 1556.1547221248388, + 1558.543432152578, + 1560.935808869442, + 1563.33185790383, + 1565.6413307578468, + 1567.5780151313854, + 1569.517095166232, + 1571.4585738258024, + 1573.4024540771713, + 1575.3487388910892, + 1577.2974312419758, + 1579.2485341079355, + 1581.2020504707525, + 1583.1579833158999, + 1585.1163356325458, + 1587.0771104135579, + 1589.0403106554975, + 1592.728254408084, + 1596.7725148558875, + 1600.8270445021715, + 1604.8918694225142, + 1608.9670157587088, + 1613.0525097189272 + ], + "p_below": 1.0447096521204458e-08, + "p_above": 9.08719997028129e-08 + } + ] + } + }, + "truncated": false, + "usage": { + "state_tokens": 528, + "image_tokens": 0, + "schema_tokens": 498, + "input_tokens": 1026, + "output_tokens": 0, + "passes": 1 + } + }, + "success": true, + "errors": [], + "messages": [] + } +} diff --git a/tests/fixtures/responses/invoice.json b/tests/fixtures/responses/invoice.json new file mode 100644 index 0000000..5fbd51d --- /dev/null +++ b/tests/fixtures/responses/invoice.json @@ -0,0 +1,123 @@ +{ + "status": 200, + "headers": { + "Content-Type": "application/json" + }, + "request": { + "model": "clairic", + "state": "Invoice INV-2291 from Northwind Supply, issued 2026-09-02, net 30. 4 pallets at $250.00 each, shipping $80.00. Contact: Dana Ruiz, Priya Shah.", + "fields": { + "invoice_number": { + "type": "text" + }, + "due_date": { + "type": "date", + "instructions": "Issue date plus the net payment days" + }, + "total": { + "type": "number", + "decimals": 2, + "unit": "USD", + "instructions": "Amount due including shipping" + }, + "contacts": { + "type": "list", + "items": "text" + }, + "po_number": { + "type": "text", + "instructions": "Purchase order number" + }, + "days_to_pay": { + "type": "estimate", + "min": 0, + "max": 120, + "step": 1, + "instructions": "Days after issue until this invoice is paid" + } + } + }, + "response": { + "result": { + "model": "clairic", + "answers": { + "invoice_number": { + "type": "text", + "p_null": 5.542365670407889e-06, + "span": [ + 8, + 16 + ], + "guess": "INV-2291", + "confidence": 0.9999814033508301, + "value": "INV-2291" + }, + "due_date": { + "type": "date", + "p_null": 9.57318320615741e-07, + "guess": "2026-10-02", + "confidence": 0.9999649532931155, + "value": "2026-10-02" + }, + "total": { + "type": "number", + "p_null": 5.512222855941218e-07, + "guess": 1080, + "confidence": 0.9999504107534636, + "value": 1080 + }, + "contacts": { + "type": "list", + "value": [ + "Dana Ruiz", + "Priya Shah" + ], + "spans": [ + [ + 120, + 129 + ], + [ + 131, + 141 + ] + ], + "confidence": 0.9998327756466797 + }, + "po_number": { + "type": "text", + "p_null": 0.9999994039535522, + "span": [ + 8, + 16 + ], + "guess": "INV-2291", + "confidence": 0.9992349147796631, + "value": null + }, + "days_to_pay": { + "type": "estimate", + "value": 31, + "mean": 30.936103609225793, + "median": 31, + "p10": 24, + "p90": 37, + "p_below": 2.312706328666536e-06, + "p_above": 5.760749445471447e-06 + } + }, + "truncated": false, + "usage": { + "state_tokens": 61, + "image_tokens": 0, + "schema_tokens": 472, + "input_tokens": 655, + "output_tokens": 0, + "passes": 3 + } + }, + "success": true, + "errors": [], + "messages": [] + } +} diff --git a/tests/fixtures/responses/missing_model.json b/tests/fixtures/responses/missing_model.json new file mode 100644 index 0000000..dd619c9 --- /dev/null +++ b/tests/fixtures/responses/missing_model.json @@ -0,0 +1,42 @@ +{ + "status": 200, + "headers": { + "Content-Type": "application/json", + "cf-ai-req-id": "6a74df57-07d6-4263-8b11-af6d42a36ef4", + "CF-RAY": "a502a0c0ba7c803e-CDG" + }, + "request": { + "state": "Total $10.", + "fields": { + "total": { + "type": "number" + } + } + }, + "response": { + "result": { + "model": "clairic", + "answers": { + "total": { + "type": "number", + "p_null": 0.0002948440960608423, + "guess": 10, + "confidence": 0.9943033370191782, + "value": 10 + } + }, + "truncated": false, + "usage": { + "state_tokens": 5, + "image_tokens": 0, + "schema_tokens": 110, + "input_tokens": 115, + "output_tokens": 0, + "passes": 1 + } + }, + "success": true, + "errors": [], + "messages": [] + } +} diff --git a/tests/fixtures/responses/model_full_name.json b/tests/fixtures/responses/model_full_name.json new file mode 100644 index 0000000..769b183 --- /dev/null +++ b/tests/fixtures/responses/model_full_name.json @@ -0,0 +1,43 @@ +{ + "status": 200, + "headers": { + "Content-Type": "application/json", + "cf-ai-req-id": "21d0233d-a285-4f04-969e-1f63c84d097d", + "CF-RAY": "a5029f49a969d0b3-CDG" + }, + "request": { + "model": "@cf/cloudflare/clairic", + "state": "Total $10.", + "fields": { + "total": { + "type": "number" + } + } + }, + "response": { + "result": { + "model": "clairic", + "answers": { + "total": { + "type": "number", + "p_null": 0.0002948440960608423, + "guess": 10, + "confidence": 0.9943033370191782, + "value": 10 + } + }, + "truncated": false, + "usage": { + "state_tokens": 5, + "image_tokens": 0, + "schema_tokens": 110, + "input_tokens": 115, + "output_tokens": 0, + "passes": 1 + } + }, + "success": true, + "errors": [], + "messages": [] + } +} diff --git a/tests/fixtures/responses/options_state_text.json b/tests/fixtures/responses/options_state_text.json new file mode 100644 index 0000000..4524d0f --- /dev/null +++ b/tests/fixtures/responses/options_state_text.json @@ -0,0 +1,93 @@ +{ + "status": 200, + "headers": { + "Content-Type": "application/json", + "cf-ai-req-id": "88afe26d-2e2a-4e99-b8a2-dcd81dead4b8", + "CF-RAY": "a5029f4799c7d87e-CDG" + }, + "request": { + "model": "clairic", + "state": " Invoice INV-9 total $10. ", + "fields": { + "invoice.number": { + "type": "text" + }, + "total-usd": { + "type": "number" + }, + "po": { + "type": "text", + "null_threshold": 0.999999, + "instructions": "Purchase order number" + }, + "po_strict": { + "type": "text", + "null_threshold": 0.01, + "instructions": "Invoice number" + } + }, + "options": { + "return_state_text": true + } + }, + "response": { + "result": { + "model": "clairic", + "answers": { + "invoice.number": { + "type": "text", + "p_null": 0.0012405809247866273, + "span": [ + 12, + 17 + ], + "guess": "INV-9", + "confidence": 0.9999991655349731, + "value": "INV-9" + }, + "total-usd": { + "type": "number", + "p_null": 0.11725785583257675, + "guess": 10, + "confidence": 0.883769606479079, + "value": 10 + }, + "po": { + "type": "text", + "p_null": 0.9997339844703674, + "span": [ + 12, + 17 + ], + "guess": "INV-9", + "confidence": 0.9633628129959106, + "value": "INV-9" + }, + "po_strict": { + "type": "text", + "p_null": 0.008373584598302841, + "span": [ + 12, + 17 + ], + "guess": "INV-9", + "confidence": 0.9999922513961792, + "value": "INV-9" + } + }, + "truncated": false, + "usage": { + "state_tokens": 13, + "image_tokens": 0, + "schema_tokens": 460, + "input_tokens": 512, + "output_tokens": 0, + "passes": 4 + }, + "state_text": " Invoice INV-9 total $10. " + }, + "success": true, + "errors": [], + "messages": [] + } +} diff --git a/tests/fixtures/responses/trunc_10k.json b/tests/fixtures/responses/trunc_10k.json new file mode 100644 index 0000000..3ec3928 --- /dev/null +++ b/tests/fixtures/responses/trunc_10k.json @@ -0,0 +1,67 @@ +{ + "status": 200, + "headers": { + "Content-Type": "application/json", + "cf-ai-req-id": "ebe2d7a6-6173-43e8-a555-ffb120b532dd", + "CF-RAY": "a502a184490aa5b5-CDG" + }, + "request": { + "model": "clairic", + "state": "<75828 chars>", + "fields": { + "first_code": { + "type": "text", + "instructions": "The first code" + }, + "last_code": { + "type": "text", + "instructions": "The last code" + } + }, + "options": { + "return_state_text": true + } + }, + "response": { + "result": { + "model": "clairic", + "answers": { + "first_code": { + "type": "text", + "p_null": 1.160401097877184e-05, + "span": [ + 32, + 40 + ], + "guess": "ALPHA-17", + "confidence": 0.9992054104804993, + "value": "ALPHA-17" + }, + "last_code": { + "type": "text", + "p_null": 1.5772737242514268e-05, + "span": [ + 75819, + 75827 + ], + "guess": "OMEGA-93", + "confidence": 0.9999632835388184, + "value": "OMEGA-93" + } + }, + "truncated": false, + "usage": { + "state_tokens": 9026, + "image_tokens": 0, + "schema_tokens": 236, + "input_tokens": 18288, + "output_tokens": 0, + "passes": 2 + }, + "state_text": "<75828 chars>" + }, + "success": true, + "errors": [], + "messages": [] + } +} diff --git a/tests/fixtures/responses/trunc_70k.json b/tests/fixtures/responses/trunc_70k.json new file mode 100644 index 0000000..1eca5fd --- /dev/null +++ b/tests/fixtures/responses/trunc_70k.json @@ -0,0 +1,36 @@ +{ + "status": 413, + "headers": { + "Content-Type": "application/json", + "cf-ai-req-id": "f68b22b1-5247-4f87-8143-5a15d23b0686", + "CF-RAY": "a502a29b5854d0b2-CDG" + }, + "request": { + "model": "clairic", + "state": "<587772 chars>", + "fields": { + "first_code": { + "type": "text", + "instructions": "The first code" + }, + "last_code": { + "type": "text", + "instructions": "The last code" + } + }, + "options": { + "return_state_text": true + } + }, + "response": { + "errors": [ + { + "message": "AiError: Ai: The estimated number of input and maximum output tokens (146999) exceeded this model context window limit (65536). (f68b22b1-5247-4f87-8143-5a15d23b0686)", + "code": 5021 + } + ], + "success": false, + "result": {}, + "messages": [] + } +} diff --git a/tests/fixtures/responses/types_absent.json b/tests/fixtures/responses/types_absent.json new file mode 100644 index 0000000..a9193b0 --- /dev/null +++ b/tests/fixtures/responses/types_absent.json @@ -0,0 +1,139 @@ +{ + "status": 200, + "headers": { + "Content-Type": "application/json", + "cf-ai-req-id": "9d64f362-a068-44f5-9bc3-d5669b29289a", + "CF-RAY": "a5029f3dc821bb68-CDG" + }, + "request": { + "model": "clairic", + "state": "Thanks for the quick reply, all good on my side.", + "fields": { + "order_id": { + "type": "text", + "instructions": "Order number" + }, + "amount": { + "type": "number", + "decimals": 2, + "instructions": "Amount paid" + }, + "delivery_date": { + "type": "date", + "instructions": "Delivery date" + }, + "delivery_time": { + "type": "time", + "instructions": "Delivery time" + }, + "meeting": { + "type": "datetime", + "instructions": "Meeting date and time" + }, + "wait": { + "type": "duration", + "unit": "minutes", + "instructions": "Waiting time" + }, + "damage": { + "type": "list", + "items": "text", + "instructions": "Each kind of damage" + }, + "quantities": { + "type": "list", + "items": "number", + "instructions": "Quantities ordered" + }, + "dates": { + "type": "list", + "items": "date", + "instructions": "Delivery dates" + } + } + }, + "response": { + "result": { + "model": "clairic", + "answers": { + "order_id": { + "type": "text", + "p_null": 0.9999881982803345, + "span": [ + 32, + 36 + ], + "guess": "good", + "confidence": 0.4486343562602997, + "value": null + }, + "amount": { + "type": "number", + "p_null": 0.9999980926513672, + "guess": 8, + "confidence": 0.005498562511406842, + "value": null + }, + "delivery_date": { + "type": "date", + "p_null": 0.9999258518218994, + "guess": "2027-11-04", + "confidence": 0.0020957674376179606, + "value": null + }, + "delivery_time": { + "type": "time", + "p_null": 0.9985406398773193, + "guess": "20:50:00", + "confidence": 0.0056097701056893505, + "value": null + }, + "meeting": { + "type": "datetime", + "p_null": 0.9997876286506653, + "guess": "2026-11-01T19:50:00", + "confidence": 9.561686729059674e-06, + "value": null + }, + "wait": { + "type": "duration", + "p_null": 0.999993085861206, + "unit": "minutes", + "guess": 0, + "confidence": 0.38242113078031115, + "value": null + }, + "damage": { + "type": "list", + "value": [], + "spans": [], + "confidence": 1 + }, + "quantities": { + "type": "list", + "value": [], + "confidences": [], + "confidence": 0.9999886751174927 + }, + "dates": { + "type": "list", + "value": [], + "confidences": [], + "confidence": 0.9999219179153442 + } + }, + "truncated": false, + "usage": { + "state_tokens": 12, + "image_tokens": 0, + "schema_tokens": 633, + "input_tokens": 657, + "output_tokens": 0, + "passes": 2 + } + }, + "success": true, + "errors": [], + "messages": [] + } +} diff --git a/tests/fixtures/responses/types_present.json b/tests/fixtures/responses/types_present.json new file mode 100644 index 0000000..693b826 --- /dev/null +++ b/tests/fixtures/responses/types_present.json @@ -0,0 +1,193 @@ +{ + "status": 200, + "headers": { + "Content-Type": "application/json", + "cf-ai-req-id": "a54d3779-4c2a-4e49-be31-214f47eb16b3", + "CF-RAY": "a5029f3b5ae78a38-CDG" + }, + "request": { + "model": "clairic", + "state": "From: Maya Chen \nSent: Tuesday, March 3, 2026 9:14 AM\nSubject: Damaged order #A-55120\n\nHi, my order #A-55120 was delivered on Feb 20 at 4:30 PM. I paid $129.99 plus 8% tax. The lid is cracked and one hinge is bent. The courier left it outside for about 3 hours in the rain. Our meeting is booked for 2026-03-05T14:00:00. Order quantities: 2 chairs, 1 table, 4 cushions. Other deliveries arrived on 2026-01-12 and 2026-02-02.\n", + "fields": { + "order_id": { + "type": "text", + "instructions": "Order number" + }, + "amount_with_tax": { + "type": "number", + "decimals": 2, + "unit": "USD", + "instructions": "Total paid including tax" + }, + "item_count": { + "type": "number", + "integer": true, + "instructions": "Total number of items ordered" + }, + "delivery_date": { + "type": "date", + "instructions": "Date the order was delivered" + }, + "delivery_time": { + "type": "time", + "instructions": "Time of day the order was delivered" + }, + "meeting": { + "type": "datetime", + "instructions": "When the meeting is booked" + }, + "rain_exposure": { + "type": "duration", + "unit": "hours", + "instructions": "How long the parcel sat outside" + }, + "days_since_delivery": { + "type": "duration", + "unit": "days", + "integer": true, + "instructions": "Days from delivery to the date the customer wrote" + }, + "damage": { + "type": "list", + "items": "text", + "instructions": "Each kind of damage described" + }, + "quantities": { + "type": "list", + "items": "number", + "instructions": "Quantities of each product ordered" + }, + "other_deliveries": { + "type": "list", + "items": "date", + "instructions": "Dates of other deliveries" + } + }, + "reference_date": "2026-03-03" + }, + "response": { + "result": { + "model": "clairic", + "answers": { + "order_id": { + "type": "text", + "p_null": 0.0019447115482762456, + "span": [ + 118, + 126 + ], + "guess": "#A-55120", + "confidence": 0.999885082244873, + "value": "#A-55120" + }, + "amount_with_tax": { + "type": "number", + "p_null": 3.5578023016569205e-07, + "guess": 140.39, + "confidence": 0.9989597705578852, + "value": 140.39 + }, + "item_count": { + "type": "number", + "p_null": 4.137498166301157e-08, + "guess": 7, + "confidence": 0.9998187145752869, + "value": 7 + }, + "delivery_date": { + "type": "date", + "p_null": 1.444568397346302e-06, + "guess": "2026-02-20", + "confidence": 0.9999986886995842, + "value": "2026-02-20" + }, + "delivery_time": { + "type": "time", + "p_null": 1.7139790697839885e-09, + "guess": "16:30:00", + "confidence": 0.9999973774024795, + "value": "16:30:00" + }, + "meeting": { + "type": "datetime", + "p_null": 6.7145258242362615e-09, + "guess": "2026-03-05T14:00:00", + "confidence": 0.9999990463265931, + "value": "2026-03-05T14:00:00" + }, + "rain_exposure": { + "type": "duration", + "p_null": 4.419167817104608e-05, + "unit": "hours", + "guess": 3, + "confidence": 0.9991839887272189, + "value": 3 + }, + "days_since_delivery": { + "type": "duration", + "p_null": 3.540374393651291e-07, + "unit": "days", + "guess": 11, + "confidence": 0.9256396303269288, + "value": 11 + }, + "damage": { + "type": "list", + "value": [ + "lid", + "one hinge is bent" + ], + "spans": [ + [ + 195, + 198 + ], + [ + 214, + 231 + ] + ], + "confidence": 0.23394100522950179 + }, + "quantities": { + "type": "list", + "value": [ + 2, + 1, + 4 + ], + "confidences": [ + 0.9999953508539718, + 0.999287134706292, + 0.9999197785239547 + ], + "confidence": 0.9991779143191255 + }, + "other_deliveries": { + "type": "list", + "value": [ + "2026-01-12", + "2026-02-02" + ], + "confidences": [ + 0.9999974966097582, + 0.9999990463265931 + ], + "confidence": 0.999956433335256 + } + }, + "truncated": false, + "usage": { + "state_tokens": 180, + "image_tokens": 0, + "schema_tokens": 797, + "input_tokens": 1157, + "output_tokens": 0, + "passes": 2 + } + }, + "success": true, + "errors": [], + "messages": [] + } +} diff --git a/tests/recorded.py b/tests/recorded.py new file mode 100644 index 0000000..0d91472 --- /dev/null +++ b/tests/recorded.py @@ -0,0 +1,35 @@ +"""Access to responses recorded from the live Clairic API (see tests/fixtures/responses).""" + +from __future__ import annotations + +import json +from pathlib import Path +from typing import Any, TypedDict, cast + +RESPONSES = Path(__file__).parent / "fixtures" / "responses" + + +class Recording(TypedDict): + status: int + headers: dict[str, str] + request: dict[str, Any] | str + response: dict[str, Any] | str + + +def load(name: str) -> Recording: + """Return the recording stored in `fixtures/responses/.json`.""" + return cast(Recording, json.loads((RESPONSES / f"{name}.json").read_text())) + + +def answers(name: str) -> dict[str, dict[str, Any]]: + """Return the raw `answers` object of a successful recording.""" + response = load(name)["response"] + assert isinstance(response, dict) + return cast(dict[str, dict[str, Any]], response["result"]["answers"]) + + +def state(name: str) -> str: + """Return the `state` sent in a recording.""" + request = load(name)["request"] + assert isinstance(request, dict) + return cast(str, request["state"]) diff --git a/tests/test_answers.py b/tests/test_answers.py new file mode 100644 index 0000000..325431b --- /dev/null +++ b/tests/test_answers.py @@ -0,0 +1,181 @@ +import datetime as dt + +import pytest +from pydantic import BaseModel, ValidationError +from recorded import answers, state + +from clairic.answers import ( + DateAnswer, + DateEstimateAnswer, + DatetimeAnswer, + DurationAnswer, + EstimateAnswer, + ForecastAnswer, + ListAnswer, + NumberAnswer, + Span, + TextAnswer, + TextListAnswer, + TimeAnswer, +) + + +class TypesPresent(BaseModel): + order_id: TextAnswer + amount_with_tax: NumberAnswer[float] + item_count: NumberAnswer[int] + delivery_date: DateAnswer + delivery_time: TimeAnswer + meeting: DatetimeAnswer + rain_exposure: DurationAnswer[float] + days_since_delivery: DurationAnswer[int] + damage: TextListAnswer + quantities: ListAnswer[int] + other_deliveries: ListAnswer[dt.date] + + +class TypesAbsent(BaseModel): + order_id: TextAnswer + amount: NumberAnswer[float] + delivery_date: DateAnswer + delivery_time: TimeAnswer + meeting: DatetimeAnswer + wait: DurationAnswer[float] + damage: TextListAnswer + quantities: ListAnswer[float] + dates: ListAnswer[dt.date] + + +class Estimates(BaseModel): + price_log: EstimateAnswer[int] + price_linear: EstimateAnswer[int] + days_on_market: EstimateAnswer[int] + sale_date: DateEstimateAnswer + sale_month: DateEstimateAnswer + unknowable: EstimateAnswer[int] + + +class Forecasts(BaseModel): + next_day: ForecastAnswer + next_days: ForecastAnswer + + +def test_single_value_answers_parse_the_recorded_values() -> None: + """Should parse every single-value and list type from a recorded response.""" + parsed = TypesPresent.model_validate(answers("types_present")) + + assert parsed.order_id.value == "#A-55120" + assert parsed.amount_with_tax.value == pytest.approx(140.39) + assert parsed.item_count.value == 7 + assert parsed.delivery_date.value == dt.date(2026, 2, 20) + assert parsed.delivery_time.value == dt.time(16, 30) + assert parsed.meeting.value == dt.datetime(2026, 3, 5, 14, 0) + assert parsed.rain_exposure.value == 3 + assert parsed.rain_exposure.unit == "hours" + assert parsed.days_since_delivery.value == 11 + assert parsed.damage.value == ["lid", "one hinge is bent"] + assert parsed.quantities.value == [2, 1, 4] + assert len(parsed.quantities.confidences) == 3 + assert parsed.other_deliveries.value == [dt.date(2026, 1, 12), dt.date(2026, 2, 2)] + + +def test_spans_slice_the_input_to_the_extracted_text() -> None: + """Should locate text answers and text list items in the input with end-exclusive spans.""" + text = state("types_present") + parsed = TypesPresent.model_validate(answers("types_present")) + + span = parsed.order_id.span + assert span is not None + assert span == Span(118, 126) + assert text[span.start : span.end] == parsed.order_id.value + assert [text[s.start : s.end] for s in parsed.damage.spans] == parsed.damage.value + + +def test_absent_values_are_none_with_a_guess() -> None: + """Should return None values with a guess and a high p_null when the input lacks them.""" + parsed = TypesAbsent.model_validate(answers("types_absent")) + + for answer in ( + parsed.order_id, + parsed.amount, + parsed.delivery_date, + parsed.delivery_time, + parsed.meeting, + parsed.wait, + ): + assert answer.value is None + assert answer.guess is not None + assert answer.p_null > 0.99 + assert parsed.damage.value == [] + assert parsed.damage.spans == [] + assert parsed.quantities.value == [] + assert parsed.dates.value == [] + + +def test_estimates_parse_numeric_and_date_distributions() -> None: + """Should parse numeric and date estimates, with 99 quantiles when they were requested.""" + parsed = Estimates.model_validate(answers("estimate_quantiles")) + + price = parsed.price_log + assert price.value == 442000 + assert price.quantiles is not None + assert len(price.quantiles) == 99 + assert (price.quantiles[9], price.quantiles[49], price.quantiles[89]) == ( + price.p10, + price.median, + price.p90, + ) + assert parsed.sale_date.value == dt.date(2026, 6, 1) + assert parsed.sale_month.p90 == dt.date(2026, 8, 1) + + +def test_estimate_value_is_the_mean_rounded_to_the_step_grid() -> None: + """Should match the documented point-estimate semantics on recorded estimates.""" + parsed = Estimates.model_validate(answers("estimate_quantiles")) + + assert parsed.price_linear.value == round(parsed.price_linear.mean, -3) + assert parsed.days_on_market.value == round(parsed.days_on_market.mean) + assert parsed.unknowable.value == round(parsed.unknowable.mean) + + +def test_estimate_without_quantiles_leaves_them_unset() -> None: + """Should set quantiles to None when the request did not ask for them.""" + parsed = EstimateAnswer[int].model_validate(answers("estimate_no_quantiles")["price_log"]) + + assert parsed.quantiles is None + + +def test_forecasts_expose_parallel_lists_and_steps() -> None: + """Should parse both the per-step lists and the steps of a forecast.""" + parsed = Forecasts.model_validate(answers("forecast_ok")) + + forecast = parsed.next_days + assert len(forecast.value) == len(forecast.steps) == 4 + assert [step.p90 for step in forecast.steps] == forecast.p90 + assert forecast.steps[0].quantiles is not None + assert len(forecast.steps[0].quantiles) == 99 + + +def test_unknown_keys_are_kept_in_model_extra() -> None: + """Should keep keys Clairic adds later instead of rejecting the answer.""" + raw = {**answers("invoice")["invoice_number"], "explanation": "new upstream key"} + + parsed = TextAnswer.model_validate(raw) + + assert parsed.model_extra == {"explanation": "new upstream key"} + + +def test_answers_are_immutable() -> None: + """Should refuse attribute assignment on an answer.""" + parsed = TextAnswer.model_validate(answers("invoice")["invoice_number"]) + + with pytest.raises(ValidationError): + parsed.value = "edited" # type: ignore[misc] + + +def test_integer_answer_rejects_a_fractional_number() -> None: + """Should reject a fractional value for a field declared with an int parameter.""" + raw = answers("types_present")["amount_with_tax"] + + with pytest.raises(ValidationError): + NumberAnswer[int].model_validate(raw) From 219ede85af9d60e40396f0a4ad3def121eddc700 Mon Sep 17 00:00:00 2001 From: Vianney Mixtur Date: Sun, 25 Oct 2026 18:05:47 +0100 Subject: [PATCH 3/9] S3 Add field specs with the API's validation rules Specs carry the options of each Clairic field type and attach to answer types through Annotated. Constructors reject every option value the live API rejected during probing (bounds, decimals, horizon, null threshold, log scale minimum, steps, duration units), so a mistake surfaces where the model is declared. pytest now also runs the doctests in src. Co-Authored-By: Claude Opus 5.5 --- pyproject.toml | 4 +- src/clairic/specs.py | 346 +++++++++++++++++++++++++++++++++++++++++++ tests/test_specs.py | 155 +++++++++++++++++++ 3 files changed, 503 insertions(+), 2 deletions(-) create mode 100644 src/clairic/specs.py create mode 100644 tests/test_specs.py diff --git a/pyproject.toml b/pyproject.toml index fbce245..ceffa07 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -69,6 +69,6 @@ pythonVersion = "3.10" typeCheckingMode = "strict" [tool.pytest.ini_options] -testpaths = ["tests"] +testpaths = ["tests", "src"] markers = ["live: calls the real Cloudflare API (needs CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN)"] -addopts = "-m 'not live'" +addopts = "-m 'not live' --doctest-modules" diff --git a/src/clairic/specs.py b/src/clairic/specs.py new file mode 100644 index 0000000..feb8d06 --- /dev/null +++ b/src/clairic/specs.py @@ -0,0 +1,346 @@ +"""Field specs: the options of a Clairic field, attached to an answer type with `Annotated`. + +A spec sets the options Clairic accepts for one field type. The answer type of the annotation +chooses the field type, and `Field(description=...)` gives the field its instructions: + +```python +class Invoice(BaseModel): + total: Annotated[NumberAnswer[float], Number(decimals=2, unit="USD")] = Field( + description="Amount due including shipping" + ) +``` + +A field without a spec uses Clairic's defaults. Estimates and forecasts always need one, since +their bounds are mandatory. Constructors reject options the Clairic API rejects, so a mistake +surfaces where the model is declared instead of in an API error. + +Source: https://developers.cloudflare.com/workers-ai/models/clairic/ +""" + +from __future__ import annotations + +import dataclasses +import datetime as dt +import math +from typing import Any, ClassVar, Literal, get_args + +from clairic.answers import DurationUnit + +__all__ = [ + "Date", + "Datetime", + "Duration", + "Estimate", + "Forecast", + "Interval", + "List", + "Number", + "Scale", + "Spec", + "Text", + "Time", +] + +Scale = Literal["linear", "log"] +"""Grid on which estimates and forecasts spread their distribution.""" + +Interval = Literal["step", "minute", "hour", "day", "week", "month", "quarter", "year"] +"""Spacing between the steps of a forecast.""" + +CalendarStep = Literal["month", "year"] +"""Step for estimates with date bounds that snaps dates to the first day of a month or year.""" + + +@dataclasses.dataclass(frozen=True, kw_only=True) +class Spec: + """Base class of field specs. + + Attributes: + field_type: ClassVar[str] + Clairic field type the spec configures. + """ + + field_type: ClassVar[str] + + def to_payload(self) -> dict[str, Any]: + """Return the options this spec sends to Clairic, leaving out the unset ones. + + Usage: + >>> Number(decimals=2, unit="USD").to_payload() + {'unit': 'USD', 'decimals': 2} + """ + payload: dict[str, Any] = {} + for field in dataclasses.fields(self): + value = getattr(self, field.name) + if value is None: + continue + payload[field.name] = value.isoformat() if isinstance(value, dt.date) else value + return payload + + +def _check_null_threshold(null_threshold: float | None) -> None: + if null_threshold is not None and not 0 < null_threshold <= 1: + raise ValueError(f"null_threshold must be in (0, 1], got {null_threshold}") + + +def _check_decimals(decimals: int | None) -> None: + if decimals is not None and not 0 <= decimals <= 6: + raise ValueError(f"decimals must be between 0 and 6, got {decimals}") + + +def _check_choice(name: str, value: str | None, choices: Any) -> None: + allowed: tuple[str, ...] = get_args(choices) + if value is not None and value not in allowed: + raise ValueError(f"{name} must be one of {', '.join(allowed)}, got {value!r}") + + +def _check_bounds( + min: float | dt.date, max: float | dt.date, step: float | str | None, scale: str | None +) -> None: + """Check the bounds, step and scale of an estimate or forecast as the Clairic API does.""" + if isinstance(min, dt.date) and isinstance(max, dt.date): + if not min < max: + raise ValueError(f"min must be lower than max, got {min} and {max}") + elif isinstance(min, (int, float)) and isinstance(max, (int, float)): + if isinstance(min, bool) or isinstance(max, bool): + raise ValueError(f"min and max must be numbers or dates, got {min!r} and {max!r}") + if not (math.isfinite(min) and math.isfinite(max)): + raise ValueError(f"min and max must be finite, got {min} and {max}") + if not min < max: + raise ValueError(f"min must be lower than max, got {min} and {max}") + if scale == "log" and min <= 0: + raise ValueError(f"scale 'log' needs min > 0, got {min}") + else: + raise ValueError(f"min and max must both be numbers or both be dates, got {min!r}, {max!r}") + if isinstance(step, str): + _check_choice("step", step, CalendarStep) + if not isinstance(min, dt.date): + raise ValueError(f"step {step!r} needs date bounds") + elif step is not None and not step > 0: + raise ValueError(f"step must be a positive number, got {step}") + + +@dataclasses.dataclass(frozen=True, kw_only=True) +class Text(Spec): + """Options of a `text` field, answered by `TextAnswer`. + + Attributes: + unit: str | None + Unit label shown to the model. + null_threshold: float | None + Probability of absence above which the value is `None`, in (0, 1]. Defaults to 0.5. + Raise it to keep low-certainty values, lower it to drop them. + """ + + field_type: ClassVar[str] = "text" + + unit: str | None = None + null_threshold: float | None = None + + def __post_init__(self) -> None: + _check_null_threshold(self.null_threshold) + + +@dataclasses.dataclass(frozen=True, kw_only=True) +class Number(Spec): + """Options of a `number` field, answered by `NumberAnswer`. + + Whole numbers are requested by annotating `NumberAnswer[int]`. + + Attributes: + unit: str | None + Unit label, such as `"USD"`. + null_threshold: float | None + Probability of absence above which the value is `None`, in (0, 1]. Defaults to 0.5. + decimals: int | None + Number of decimals to round to, between 0 and 6. + """ + + field_type: ClassVar[str] = "number" + + unit: str | None = None + null_threshold: float | None = None + decimals: int | None = None + + def __post_init__(self) -> None: + _check_null_threshold(self.null_threshold) + _check_decimals(self.decimals) + + +@dataclasses.dataclass(frozen=True, kw_only=True) +class Date(Spec): + """Options of a `date` field, answered by `DateAnswer`. + + Attributes: + null_threshold: float | None + Probability of absence above which the value is `None`, in (0, 1]. Defaults to 0.5. + """ + + field_type: ClassVar[str] = "date" + + null_threshold: float | None = None + + def __post_init__(self) -> None: + _check_null_threshold(self.null_threshold) + + +@dataclasses.dataclass(frozen=True, kw_only=True) +class Time(Spec): + """Options of a `time` field, answered by `TimeAnswer`. + + Attributes: + null_threshold: float | None + Probability of absence above which the value is `None`, in (0, 1]. Defaults to 0.5. + """ + + field_type: ClassVar[str] = "time" + + null_threshold: float | None = None + + def __post_init__(self) -> None: + _check_null_threshold(self.null_threshold) + + +@dataclasses.dataclass(frozen=True, kw_only=True) +class Datetime(Spec): + """Options of a `datetime` field, answered by `DatetimeAnswer`. + + Attributes: + null_threshold: float | None + Probability of absence above which the value is `None`, in (0, 1]. Defaults to 0.5. + """ + + field_type: ClassVar[str] = "datetime" + + null_threshold: float | None = None + + def __post_init__(self) -> None: + _check_null_threshold(self.null_threshold) + + +@dataclasses.dataclass(frozen=True, kw_only=True) +class Duration(Spec): + """Options of a `duration` field, answered by `DurationAnswer`. + + Whole units are requested by annotating `DurationAnswer[int]`. + + Attributes: + unit: DurationUnit + Unit of the answer. Defaults to seconds. + null_threshold: float | None + Probability of absence above which the value is `None`, in (0, 1]. Defaults to 0.5. + decimals: int | None + Number of decimals to round to, between 0 and 6. + """ + + field_type: ClassVar[str] = "duration" + + unit: DurationUnit = "seconds" + null_threshold: float | None = None + decimals: int | None = None + + def __post_init__(self) -> None: + _check_choice("unit", self.unit, DurationUnit) + _check_null_threshold(self.null_threshold) + _check_decimals(self.decimals) + + +@dataclasses.dataclass(frozen=True, kw_only=True) +class List(Spec): + """Options of a `list` field, answered by `TextListAnswer` or `ListAnswer`. + + The item type comes from the annotation: `TextListAnswer` for text, `ListAnswer[int]`, + `ListAnswer[float]` or `ListAnswer[date]` for numbers and dates. + + Attributes: + unit: str | None + Unit label of the items. + decimals: int | None + Number of decimals to round number items to, between 0 and 6. + """ + + field_type: ClassVar[str] = "list" + + unit: str | None = None + decimals: int | None = None + + def __post_init__(self) -> None: + _check_decimals(self.decimals) + + +@dataclasses.dataclass(frozen=True, kw_only=True) +class Estimate(Spec): + """Options of an `estimate` field, answered by `EstimateAnswer` or `DateEstimateAnswer`. + + Clairic spreads a distribution over `[min, max]` on a grid of `step`. Use number bounds with + `EstimateAnswer` and date bounds with `DateEstimateAnswer`. Estimates need evidence in the + input: comparable sales for a price, payment terms for a payment date. + + Attributes: + min: float | date + Lower bound of the distribution. + max: float | date + Upper bound of the distribution. + step: float | CalendarStep | None + Grid spacing: a positive number (days for date bounds), or `"month"` or `"year"` + for date bounds. + scale: Scale | None + `"linear"` (default) or `"log"`. A log scale suits quantities spanning orders of + magnitude, such as prices, and needs `min > 0`. + unit: str | None + Unit label, such as `"USD"`. + """ + + field_type: ClassVar[str] = "estimate" + + min: float | dt.date + max: float | dt.date + step: float | CalendarStep | None = None + scale: Scale | None = None + unit: str | None = None + + def __post_init__(self) -> None: + _check_choice("scale", self.scale, Scale) + _check_bounds(self.min, self.max, self.step, self.scale) + + +@dataclasses.dataclass(frozen=True, kw_only=True) +class Forecast(Spec): + """Options of a `forecast` field, answered by `ForecastAnswer`. + + Clairic forecasts `horizon` future steps of the series found in the input, each as a + distribution over `[min, max]`. + + Attributes: + min: float + Lower bound of every step. + max: float + Upper bound of every step. + horizon: int + Number of steps to forecast, between 1 and 64. + interval: Interval | None + Spacing between steps, such as `"day"`. + step: float | None + Grid spacing of each step's distribution, a positive number. + scale: Scale | None + `"linear"` (default) or `"log"`, which needs `min > 0`. + unit: str | None + Unit label of the series. + """ + + field_type: ClassVar[str] = "forecast" + + min: float + max: float + horizon: int + interval: Interval | None = None + step: float | None = None + scale: Scale | None = None + unit: str | None = None + + def __post_init__(self) -> None: + if not 1 <= self.horizon <= 64: + raise ValueError(f"horizon must be between 1 and 64, got {self.horizon}") + _check_choice("interval", self.interval, Interval) + _check_choice("scale", self.scale, Scale) + _check_bounds(self.min, self.max, self.step, self.scale) diff --git a/tests/test_specs.py b/tests/test_specs.py new file mode 100644 index 0000000..56153d4 --- /dev/null +++ b/tests/test_specs.py @@ -0,0 +1,155 @@ +"""Spec payloads and constructor rules. + +Every rejected value below was rejected by the live API on 2026-10-25; the recorded response is +named in each test (tests/fixtures/responses/err_*.json). +""" + +import datetime as dt +import math + +import pytest + +from clairic.specs import ( + Date, + Datetime, + Duration, + Estimate, + Forecast, + List, + Number, + Spec, + Text, + Time, +) + +# Keys the live API accepts per field type, besides `type` and `instructions`, as listed in its +# error messages (err_unknown_field_key and the keys_* probes). +ACCEPTED_KEYS = { + "text": {"unit", "null_threshold"}, + "number": {"unit", "null_threshold", "integer", "decimals"}, + "date": {"unit", "null_threshold"}, + "time": {"unit", "null_threshold"}, + "datetime": {"unit", "null_threshold"}, + "duration": {"unit", "null_threshold", "integer", "decimals"}, + "list": {"unit", "items", "integer", "decimals"}, + "estimate": {"unit", "min", "max", "scale", "step"}, + "forecast": {"unit", "min", "max", "scale", "step", "horizon", "interval"}, +} + +FULLY_SET: list[Spec] = [ + Text(unit="ref", null_threshold=0.9), + Number(unit="USD", null_threshold=0.9, decimals=2), + Date(null_threshold=0.9), + Time(null_threshold=0.9), + Datetime(null_threshold=0.9), + Duration(unit="days", null_threshold=0.9, decimals=1), + List(unit="USD", decimals=2), + Estimate(min=1, max=10, step=1, scale="log", unit="USD"), + Forecast(min=1, max=10, horizon=3, interval="day", step=1, scale="log", unit="visitors"), +] + + +@pytest.mark.parametrize("spec", FULLY_SET, ids=lambda spec: spec.field_type) +def test_payload_only_uses_keys_the_api_accepts(spec: Spec) -> None: + """Should send only keys the Clairic API accepts for the spec's field type.""" + assert set(spec.to_payload()) <= ACCEPTED_KEYS[spec.field_type] + + +def test_payload_leaves_out_unset_options() -> None: + """Should send no key for an option left unset.""" + assert Text().to_payload() == {} + assert Number(decimals=0).to_payload() == {"decimals": 0} + + +def test_duration_unit_defaults_to_seconds() -> None: + """Should always send a duration unit, defaulting to seconds as the API does.""" + assert Duration().to_payload() == {"unit": "seconds"} + + +def test_date_bounds_are_sent_as_iso_dates() -> None: + """Should serialize date bounds of an estimate as ISO dates.""" + spec = Estimate(min=dt.date(2026, 1, 1), max=dt.date(2027, 1, 1), step="month") + + assert spec.to_payload() == {"min": "2026-01-01", "max": "2027-01-01", "step": "month"} + + +@pytest.mark.parametrize("null_threshold", [0, -0.1, 1.5]) +def test_null_threshold_outside_zero_one_is_rejected(null_threshold: float) -> None: + """Should reject a null_threshold outside (0, 1] (err_null_threshold_zero).""" + with pytest.raises(ValueError, match="null_threshold"): + Text(null_threshold=null_threshold) + + +@pytest.mark.parametrize("decimals", [-1, 7]) +def test_decimals_outside_zero_six_are_rejected(decimals: int) -> None: + """Should reject decimals outside 0 to 6 (err_decimals_7).""" + with pytest.raises(ValueError, match="decimals"): + Number(decimals=decimals) + + +@pytest.mark.parametrize("horizon", [0, 65]) +def test_horizon_outside_one_sixty_four_is_rejected(horizon: int) -> None: + """Should reject a forecast horizon outside 1 to 64 (err_horizon_65).""" + with pytest.raises(ValueError, match="horizon"): + Forecast(min=0, max=10, horizon=horizon) + + +def test_unknown_duration_unit_is_rejected() -> None: + """Should reject a duration unit Clairic does not know (err_bad_duration_unit).""" + with pytest.raises(ValueError, match="unit"): + Duration(unit="fortnights") # type: ignore[arg-type] + + +@pytest.mark.parametrize( + ("min", "max"), [(10, 5), (5, 5), (dt.date(2027, 1, 1), dt.date(2026, 1, 1))] +) +def test_min_not_below_max_is_rejected(min: float | dt.date, max: float | dt.date) -> None: + """Should reject bounds where min is not lower than max (err_estimate_min_ge_max).""" + with pytest.raises(ValueError, match="lower than max"): + Estimate(min=min, max=max) + + +def test_infinite_bounds_are_rejected() -> None: + """Should reject infinite bounds, which the API refuses as not finite.""" + with pytest.raises(ValueError, match="finite"): + Estimate(min=0, max=math.inf) + + +def test_mixed_number_and_date_bounds_are_rejected() -> None: + """Should reject bounds mixing a number and a date.""" + with pytest.raises(ValueError, match="both"): + Estimate(min=0, max=dt.date(2026, 1, 1)) + + +@pytest.mark.parametrize("min", [0, -5]) +def test_log_scale_needs_positive_min(min: float) -> None: + """Should reject a log scale whose min is not positive (forecast probe with min 0).""" + with pytest.raises(ValueError, match="log"): + Forecast(min=min, max=10, horizon=1, scale="log") + + +@pytest.mark.parametrize("step", [0, -1]) +def test_non_positive_step_is_rejected(step: float) -> None: + """Should reject a step that is not positive (err_bad_step).""" + with pytest.raises(ValueError, match="positive"): + Estimate(min=0, max=10, step=step) + + +def test_unknown_calendar_step_is_rejected() -> None: + """Should reject a calendar step other than month or year (err_bad_step).""" + with pytest.raises(ValueError, match="step"): + Estimate(min=dt.date(2026, 1, 1), max=dt.date(2027, 1, 1), step="week") # type: ignore[arg-type] + + +def test_calendar_step_needs_date_bounds() -> None: + """Should reject a month or year step on number bounds.""" + with pytest.raises(ValueError, match="date bounds"): + Estimate(min=0, max=10, step="month") + + +def test_specs_are_immutable() -> None: + """Should refuse attribute assignment on a spec.""" + spec = Number(decimals=2) + + with pytest.raises(AttributeError): + spec.decimals = 3 # type: ignore[misc] From 2e3cc1fb8ed7fb14efcb4a46e25c2c3eabc98d2f Mon Sep 17 00:00:00 2001 From: Vianney Mixtur Date: Sun, 25 Oct 2026 18:07:47 +0100 Subject: [PATCH 4/9] S4 Compile extraction models into Clairic fields The compiler turns a Pydantic model whose fields are answer types into the Clairic `fields` object and reads the answers back into the model. The answer type picks the Clairic field type and implies `integer` and list `items`; an Annotated spec adds options; Field(description=...) becomes the instructions; an alias becomes the Clairic field name. Invalid models raise ModelDefinitionError naming the field, before any request. Compiled payloads are cached per model class. tests/typing holds assert_type checks that pyright enforces, including attribute accesses that must stay type errors. Co-Authored-By: Claude Opus 5.5 --- src/clairic/_compile.py | 196 ++++++++++++++++++++++++++++++++ tests/test_compile.py | 210 +++++++++++++++++++++++++++++++++++ tests/typing/answer_types.py | 58 ++++++++++ 3 files changed, 464 insertions(+) create mode 100644 src/clairic/_compile.py create mode 100644 tests/test_compile.py create mode 100644 tests/typing/answer_types.py diff --git a/src/clairic/_compile.py b/src/clairic/_compile.py new file mode 100644 index 0000000..86a77b2 --- /dev/null +++ b/src/clairic/_compile.py @@ -0,0 +1,196 @@ +"""Translation between extraction models and the Clairic request and response.""" + +from __future__ import annotations + +import datetime as dt +import functools +import re +from dataclasses import dataclass +from typing import Any, TypeVar + +from pydantic import BaseModel +from pydantic.fields import FieldInfo + +from clairic.answers import ( + DateAnswer, + DateEstimateAnswer, + DatetimeAnswer, + DurationAnswer, + EstimateAnswer, + ForecastAnswer, + ListAnswer, + NumberAnswer, + TextAnswer, + TextListAnswer, + TimeAnswer, +) +from clairic.errors import ModelDefinitionError +from clairic.specs import ( + Date, + Datetime, + Duration, + Estimate, + Forecast, + List, + Number, + Spec, + Text, + Time, +) + +M = TypeVar("M", bound=BaseModel) + +FIELD_NAME = re.compile(r"^[A-Za-z_][A-Za-z0-9_.\-]{0,63}$") +"""Field names the Clairic API accepts.""" + + +@dataclass(frozen=True) +class _AnswerKind: + """How an answer class maps to a Clairic field.""" + + spec_type: type[Spec] + spec_required: bool = False + + +_KINDS: dict[type[BaseModel], _AnswerKind] = { + TextAnswer: _AnswerKind(Text), + NumberAnswer: _AnswerKind(Number), + DateAnswer: _AnswerKind(Date), + TimeAnswer: _AnswerKind(Time), + DatetimeAnswer: _AnswerKind(Datetime), + DurationAnswer: _AnswerKind(Duration), + TextListAnswer: _AnswerKind(List), + ListAnswer: _AnswerKind(List), + EstimateAnswer: _AnswerKind(Estimate, spec_required=True), + DateEstimateAnswer: _AnswerKind(Estimate, spec_required=True), + ForecastAnswer: _AnswerKind(Forecast, spec_required=True), +} +_GENERIC = (NumberAnswer, DurationAnswer, ListAnswer, EstimateAnswer) +_SUPPORTED = ", ".join( + f"{answer.__name__}[...]" if answer in _GENERIC else answer.__name__ for answer in _KINDS +) + + +def fields_payload(model: type[BaseModel]) -> dict[str, dict[str, Any]]: + """Return the Clairic `fields` object for an extraction model. + + Raises: + ModelDefinitionError: + When a field of `model` cannot be sent to Clairic. The message names the field. + """ + return {name: dict(spec) for name, spec in _compile(model)} + + +def build_data(model: type[M], answers: dict[str, Any]) -> M: + """Return an instance of `model` holding the answers Clairic returned, keyed by field name.""" + return model.model_validate(answers) + + +@functools.cache +def _compile(model: type[BaseModel]) -> tuple[tuple[str, dict[str, Any]], ...]: + if not model.model_fields: + raise ModelDefinitionError(f"{model.__name__} has no fields; Clairic needs at least one") + return tuple( + _compile_field(model, attribute, info) for attribute, info in model.model_fields.items() + ) + + +def _compile_field( + model: type[BaseModel], attribute: str, info: FieldInfo +) -> tuple[str, dict[str, Any]]: + where = f"{model.__name__}.{attribute}" + name = _clairic_name(where, attribute, info) + origin, argument = _answer_class(where, info.annotation) + kind = _KINDS[origin] + spec = _spec(where, info, kind) + + payload: dict[str, Any] = {"type": spec.field_type} + if info.description: + payload["instructions"] = info.description + payload.update(spec.to_payload()) + payload.update(_type_options(where, origin, argument, spec)) + return name, payload + + +def _clairic_name(where: str, attribute: str, info: FieldInfo) -> str: + """Return the field name sent to Clairic: the alias when set, else the attribute name.""" + if info.validation_alias is not None and info.validation_alias != info.alias: + raise ModelDefinitionError( + f"{where}: validation_alias is not supported; use alias to rename the field" + ) + name = info.alias or attribute + if not FIELD_NAME.match(name): + raise ModelDefinitionError( + f"{where}: Clairic field names must match {FIELD_NAME.pattern}, got {name!r}" + ) + return name + + +def _answer_class(where: str, annotation: Any) -> tuple[type[BaseModel], Any]: + """Return the unparametrized answer class of an annotation and its type argument.""" + metadata = getattr(annotation, "__pydantic_generic_metadata__", None) + if isinstance(annotation, type) and issubclass(annotation, BaseModel) and metadata: + origin = metadata["origin"] or annotation + if origin in _KINDS: + arguments = metadata["args"] + if origin in _GENERIC and not arguments: + raise ModelDefinitionError( + f"{where}: parametrize {origin.__name__} with its value type, " + f"for example {origin.__name__}[float]" + ) + return origin, arguments[0] if arguments else None + raise ModelDefinitionError( + f"{where}: annotate the field with a Clairic answer type ({_SUPPORTED}), " + f"got {annotation!r}. Answers already allow a None value; do not wrap them in Optional" + ) + + +def _spec(where: str, info: FieldInfo, kind: _AnswerKind) -> Spec: + specs = [item for item in info.metadata if isinstance(item, Spec)] + if len(specs) > 1: + raise ModelDefinitionError(f"{where}: declare at most one spec, got {len(specs)}") + if not specs: + if kind.spec_required: + raise ModelDefinitionError( + f"{where}: add an {kind.spec_type.__name__}(...) spec with Annotated; " + "its bounds are required" + ) + return kind.spec_type() + spec = specs[0] + if not isinstance(spec, kind.spec_type): + raise ModelDefinitionError( + f"{where}: {type(spec).__name__} does not apply to this answer type; " + f"use {kind.spec_type.__name__}" + ) + return spec + + +def _type_options(where: str, origin: type[BaseModel], argument: Any, spec: Spec) -> dict[str, Any]: + """Return the options implied by the answer type: `integer` and list `items`.""" + if origin in (NumberAnswer, DurationAnswer): + return {"integer": True} if argument is int else {} + if origin is TextListAnswer: + return {"items": "text"} + if origin is ListAnswer: + if argument is dt.date: + return {"items": "date"} + return {"items": "number", "integer": True} if argument is int else {"items": "number"} + if isinstance(spec, Estimate): + _check_estimate_bounds(where, origin, argument, spec) + return {} + + +def _check_estimate_bounds( + where: str, origin: type[BaseModel], argument: Any, spec: Estimate +) -> None: + date_bounds = isinstance(spec.min, dt.date) + if origin is DateEstimateAnswer and not date_bounds: + raise ModelDefinitionError(f"{where}: DateEstimateAnswer needs date bounds") + if origin is EstimateAnswer and date_bounds: + raise ModelDefinitionError(f"{where}: use DateEstimateAnswer for date bounds") + if argument is int and not ( + isinstance(spec.step, (int, float)) and float(spec.step).is_integer() + ): + raise ModelDefinitionError( + f"{where}: EstimateAnswer[int] needs a whole-number step, got {spec.step!r}" + ) diff --git a/tests/test_compile.py b/tests/test_compile.py new file mode 100644 index 0000000..8de4441 --- /dev/null +++ b/tests/test_compile.py @@ -0,0 +1,210 @@ +import datetime as dt +from typing import Annotated, Any + +import pytest +from pydantic import BaseModel, Field +from recorded import answers, load + +from clairic._compile import build_data, fields_payload +from clairic.answers import ( + DateAnswer, + DateEstimateAnswer, + DatetimeAnswer, + DurationAnswer, + EstimateAnswer, + ForecastAnswer, + ListAnswer, + NumberAnswer, + TextAnswer, + TextListAnswer, + TimeAnswer, +) +from clairic.errors import ModelDefinitionError +from clairic.specs import Duration, Estimate, Forecast, Number, Text + + +class Invoice(BaseModel): + """The invoice example of the Clairic model reference.""" + + invoice_number: TextAnswer + due_date: DateAnswer = Field(description="Issue date plus the net payment days") + total: Annotated[NumberAnswer[float], Number(decimals=2, unit="USD")] = Field( + description="Amount due including shipping" + ) + contacts: TextListAnswer + po_number: TextAnswer = Field(description="Purchase order number") + days_to_pay: Annotated[EstimateAnswer[int], Estimate(min=0, max=120, step=1)] = Field( + description="Days after issue until this invoice is paid" + ) + + +def test_reference_invoice_compiles_to_the_documented_fields() -> None: + """Should produce the `fields` object of the Clairic reference invoice example.""" + request = load("invoice")["request"] + assert isinstance(request, dict) + + assert fields_payload(Invoice) == request["fields"] + + +def test_every_field_type_compiles_with_its_implied_options() -> None: + """Should derive integer and list items from the answer type parameters.""" + + class Everything(BaseModel): + count: NumberAnswer[int] + when: DateAnswer + at: TimeAnswer + meeting: DatetimeAnswer + wait: Annotated[DurationAnswer[int], Duration(unit="days")] + waited: DurationAnswer[float] + names: TextListAnswer + quantities: ListAnswer[int] + prices: ListAnswer[float] + dates: ListAnswer[dt.date] + sale: Annotated[ + DateEstimateAnswer, + Estimate(min=dt.date(2026, 1, 1), max=dt.date(2027, 1, 1), step="month"), + ] + visitors: Annotated[ForecastAnswer, Forecast(min=0, max=5000, horizon=4, interval="day")] + + assert fields_payload(Everything) == { + "count": {"type": "number", "integer": True}, + "when": {"type": "date"}, + "at": {"type": "time"}, + "meeting": {"type": "datetime"}, + "wait": {"type": "duration", "unit": "days", "integer": True}, + "waited": {"type": "duration", "unit": "seconds"}, + "names": {"type": "list", "items": "text"}, + "quantities": {"type": "list", "items": "number", "integer": True}, + "prices": {"type": "list", "items": "number"}, + "dates": {"type": "list", "items": "date"}, + "sale": {"type": "estimate", "min": "2026-01-01", "max": "2027-01-01", "step": "month"}, + "visitors": {"type": "forecast", "min": 0, "max": 5000, "horizon": 4, "interval": "day"}, + } + + +def test_alias_is_the_clairic_field_name() -> None: + """Should send the alias as the field name, allowing dots and dashes.""" + + class Aliased(BaseModel): + invoice_number: TextAnswer = Field(alias="invoice.number") + total_usd: NumberAnswer[float] = Field(alias="total-usd") + + assert set(fields_payload(Aliased)) == {"invoice.number", "total-usd"} + + +def test_aliased_answers_are_read_back_into_the_model() -> None: + """Should fill aliased attributes from answers keyed by the Clairic field name.""" + + class Aliased(BaseModel): + invoice_number: TextAnswer = Field(alias="invoice.number") + total_usd: NumberAnswer[float] = Field(alias="total-usd") + + data = build_data(Aliased, answers("options_state_text")) + + assert data.invoice_number.value == "INV-9" + assert data.total_usd.value == 10 + + +def test_payload_is_a_fresh_copy_on_every_call() -> None: + """Should not let a caller mutate the cached compilation.""" + fields_payload(Invoice)["total"]["decimals"] = 6 + + assert fields_payload(Invoice)["total"]["decimals"] == 2 + + +class _NotAnAnswer(BaseModel): + total: float + + +class _Optional(BaseModel): + total: TextAnswer | None + + +class _Unparametrized(BaseModel): + total: NumberAnswer # type: ignore[type-arg] + + +class _MissingSpec(BaseModel): + days: EstimateAnswer[int] + + +class _WrongSpec(BaseModel): + total: Annotated[NumberAnswer[float], Text()] + + +class _TwoSpecs(BaseModel): + total: Annotated[NumberAnswer[float], Number(decimals=1), Number(decimals=2)] + + +class _DateBoundsOnNumbers(BaseModel): + when: Annotated[EstimateAnswer[int], Estimate(min=dt.date(2026, 1, 1), max=dt.date(2027, 1, 1))] + + +class _NumberBoundsOnDates(BaseModel): + when: Annotated[DateEstimateAnswer, Estimate(min=0, max=10)] + + +class _FractionalStep(BaseModel): + days: Annotated[EstimateAnswer[int], Estimate(min=0, max=10, step=0.5)] + + +class _MissingStep(BaseModel): + days: Annotated[EstimateAnswer[int], Estimate(min=0, max=10)] + + +class _InvalidName(BaseModel): + total: TextAnswer = Field(alias="1total") + + +class _ValidationAlias(BaseModel): + total: TextAnswer = Field(validation_alias="sum") + + +class _Empty(BaseModel): + pass + + +@pytest.mark.parametrize( + ("model", "message"), + [ + (_NotAnAnswer, "annotate the field with a Clairic answer type"), + (_Optional, "do not wrap them in Optional"), + (_Unparametrized, r"NumberAnswer\[float\]"), + (_MissingSpec, "add an Estimate"), + (_WrongSpec, "use Number"), + (_TwoSpecs, "at most one spec"), + (_DateBoundsOnNumbers, "use DateEstimateAnswer"), + (_NumberBoundsOnDates, "needs date bounds"), + (_FractionalStep, "whole-number step"), + (_MissingStep, "whole-number step"), + (_InvalidName, "field names must match"), + (_ValidationAlias, "validation_alias"), + (_Empty, "no fields"), + ], +) +def test_invalid_models_are_rejected_with_the_field_name( + model: type[BaseModel], message: str +) -> None: + """Should raise ModelDefinitionError naming the problem before any request.""" + with pytest.raises(ModelDefinitionError, match=message) as raised: + fields_payload(model) + + assert model.__name__ in str(raised.value) + + +def test_recorded_types_compile_and_read_back() -> None: + """Should read every recorded answer of a full extraction back into the model.""" + + class Recorded(BaseModel): + order_id: TextAnswer + amount_with_tax: NumberAnswer[float] + delivery_date: DateAnswer + rain_exposure: Annotated[DurationAnswer[float], Duration(unit="hours")] + damage: TextListAnswer + quantities: ListAnswer[int] + + raw: dict[str, Any] = answers("types_present") + data = build_data(Recorded, raw) + + assert data.rain_exposure.unit == "hours" + assert data.quantities.value == [2, 1, 4] diff --git a/tests/typing/answer_types.py b/tests/typing/answer_types.py new file mode 100644 index 0000000..9e57845 --- /dev/null +++ b/tests/typing/answer_types.py @@ -0,0 +1,58 @@ +"""Static typing guarantees of extraction models, checked by pyright (never executed). + +`reportUnnecessaryTypeIgnoreComment` turns each `pyright: ignore` below into an assertion that +the line is a type error. +""" +# pyright: reportUnnecessaryTypeIgnoreComment=true + +import datetime as dt +from typing import Annotated + +from pydantic import BaseModel +from typing_extensions import assert_type + +from clairic.answers import ( + DateEstimateAnswer, + DurationAnswer, + EstimateAnswer, + ForecastAnswer, + ListAnswer, + NumberAnswer, + Span, + TextAnswer, + TextListAnswer, +) +from clairic.specs import Estimate, Forecast + + +class Extraction(BaseModel): + invoice_number: TextAnswer + total: NumberAnswer[float] + items: NumberAnswer[int] + wait: DurationAnswer[int] + contacts: TextListAnswer + dates: ListAnswer[dt.date] + days_to_pay: Annotated[EstimateAnswer[int], Estimate(min=0, max=120, step=1)] + sale: Annotated[DateEstimateAnswer, Estimate(min=dt.date(2026, 1, 1), max=dt.date(2027, 1, 1))] + visitors: Annotated[ForecastAnswer, Forecast(min=0, max=10, horizon=2)] + + +def check(data: Extraction) -> None: + assert_type(data.invoice_number.value, str | None) + assert_type(data.invoice_number.span, Span | None) + assert_type(data.total.value, float | None) + assert_type(data.items.guess, int | None) + assert_type(data.wait.value, int | None) + assert_type(data.contacts.spans, list[Span]) + assert_type(data.dates.value, list[dt.date]) + assert_type(data.dates.confidences, list[float]) + assert_type(data.days_to_pay.p90, int) + assert_type(data.days_to_pay.mean, float) + assert_type(data.sale.median, dt.date) + assert_type(data.visitors.steps[0].p10, float) + + _ = data.total.span # pyright: ignore + _ = data.days_to_pay.confidence # pyright: ignore + _ = data.sale.p_below # pyright: ignore + _ = data.dates.spans # pyright: ignore + _ = data.invoice_numbr # pyright: ignore From b52c32240310fb0e913d712d36fac291a1ece4fd Mon Sep 17 00:00:00 2001 From: Vianney Mixtur Date: Sun, 25 Oct 2026 18:09:30 +0100 Subject: [PATCH 5/9] S5 Add Result with the values export Result[M] holds the extraction model, token usage, the truncation flag and the request id. It round-trips through JSON, including models with aliased fields, which are dumped under their Clairic names. values_as(Target) copies each answer value into the same-named field of a plain-values model and lets Pydantic validate it. Usage documents that input tokens count the state once per pass. Co-Authored-By: Claude Opus 5.5 --- src/clairic/result.py | 111 +++++++++++++++++++++++++++++ tests/test_result.py | 133 +++++++++++++++++++++++++++++++++++ tests/typing/answer_types.py | 12 ++++ 3 files changed, 256 insertions(+) create mode 100644 src/clairic/result.py create mode 100644 tests/test_result.py diff --git a/src/clairic/result.py b/src/clairic/result.py new file mode 100644 index 0000000..5aca540 --- /dev/null +++ b/src/clairic/result.py @@ -0,0 +1,111 @@ +"""The outcome of an extraction: answers, token usage and request metadata.""" + +from __future__ import annotations + +from typing import Any, Generic, TypeVar + +from pydantic import ( + BaseModel, + ConfigDict, + SerializationInfo, + SerializerFunctionWrapHandler, + field_serializer, +) + +from clairic.answers import Answer + +__all__ = ["Result", "Usage"] + +M = TypeVar("M", bound=BaseModel) +P = TypeVar("P", bound=BaseModel) + + +class Usage(BaseModel): + """Token counts of an extraction. Clairic bills input tokens only. + + Fields that do not fit next to the input in one 8,192-token pass are split across parallel + passes, and every pass reads the whole input: `input_tokens` counts the state once per pass. + Fewer fields, or a shorter input, lower the number of passes. + + Attributes: + state_tokens: int + Tokens of the input text. + image_tokens: int + Tokens of the input images. + schema_tokens: int + Tokens of the field definitions. + input_tokens: int + Billed input tokens, across all passes. + output_tokens: int + Generated tokens, always 0: Clairic answers without generating text. + passes: int + Number of parallel passes the fields were split into. + """ + + model_config = ConfigDict(frozen=True, extra="allow") + + state_tokens: int + image_tokens: int + schema_tokens: int + input_tokens: int + output_tokens: int + passes: int + + +class Result(BaseModel, Generic[M]): + """Answers to an extraction, with its token usage and request metadata. + + A result serializes to JSON and back, so storing it keeps the answers, the usage and the + request id together: + + ```python + stored = res.model_dump_json() + res = Result[Invoice].model_validate_json(stored) + ``` + + Attributes: + data: M + The extraction model, holding one answer per field. + usage: Usage + Token counts of the request. + truncated: bool + True when Clairic computed the answers on part of the input only. + model: str + Clairic model that answered. + request_id: str | None + Workers AI request id, to quote when contacting Cloudflare. + """ + + model_config = ConfigDict(frozen=True) + + data: M + usage: Usage + truncated: bool + model: str + request_id: str | None = None + + @field_serializer("data", mode="wrap") + def _serialize_data_by_alias( + self, data: M, handler: SerializerFunctionWrapHandler, info: SerializationInfo + ) -> Any: + # Answers arrive keyed by Clairic field name (the alias), so dump them the same way. + return data.model_dump(mode=info.mode, by_alias=True) + + def values_as(self, target: type[P]) -> P: + """Return the answer values as an instance of `target`, a model of plain values. + + Each field of `target` receives the `value` of the answer with the same attribute name; + answers without a matching field are left out. Pydantic validates the values, so a + `None` value in a field of `target` that does not accept `None` raises + `pydantic.ValidationError`. + + Args: + target: type[P] + Pydantic model with plain value fields, such as `total: float | None`. + """ + values: dict[str, Any] = {} + for attribute in type(self.data).model_fields: + answer = getattr(self.data, attribute) + if attribute in target.model_fields and isinstance(answer, Answer): + values[attribute] = answer.model_dump(include={"value"})["value"] + return target.model_validate(values) diff --git a/tests/test_result.py b/tests/test_result.py new file mode 100644 index 0000000..27ad8a4 --- /dev/null +++ b/tests/test_result.py @@ -0,0 +1,133 @@ +import datetime as dt +from typing import Annotated, Any + +import pytest +from pydantic import BaseModel, ConfigDict, Field, ValidationError +from recorded import answers, load + +from clairic._compile import build_data +from clairic.answers import ( + DateAnswer, + EstimateAnswer, + ForecastAnswer, + NumberAnswer, + TextAnswer, + TextListAnswer, +) +from clairic.result import Result, Usage +from clairic.specs import Estimate, Forecast + + +class InvoiceExtraction(BaseModel): + invoice_number: TextAnswer + due_date: DateAnswer + total: NumberAnswer[float] + contacts: TextListAnswer + po_number: TextAnswer + days_to_pay: Annotated[EstimateAnswer[int], Estimate(min=0, max=120, step=1)] + + +class Invoice(BaseModel): + invoice_number: str + due_date: dt.date + total: float + contacts: list[str] + po_number: str | None + days_to_pay: int + + +def _result(model: type[Any], fixture: str) -> Result[Any]: + response = load(fixture)["response"] + assert isinstance(response, dict) + result = response["result"] + return Result[model]( + data=build_data(model, result["answers"]), + usage=Usage.model_validate(result["usage"]), + truncated=result["truncated"], + model=result["model"], + request_id="21d0233d-a285-4f04-969e-1f63c84d097d", + ) + + +def test_values_as_returns_the_plain_values() -> None: + """Should copy each answer value into the field of the same name.""" + invoice = _result(InvoiceExtraction, "invoice").values_as(Invoice) + + assert invoice == Invoice( + invoice_number="INV-2291", + due_date=dt.date(2026, 10, 2), + total=1080, + contacts=["Dana Ruiz", "Priya Shah"], + po_number=None, + days_to_pay=31, + ) + + +def test_values_as_rejects_none_in_a_required_field() -> None: + """Should raise a validation error when a None value lands in a non-Optional field.""" + + class StrictInvoice(BaseModel): + po_number: str + + with pytest.raises(ValidationError, match="po_number"): + _result(InvoiceExtraction, "invoice").values_as(StrictInvoice) + + +def test_values_as_fills_a_subset_of_fields() -> None: + """Should leave out answers the target does not declare, even with extra='forbid'.""" + + class Totals(BaseModel): + model_config = ConfigDict(extra="forbid") + total: float + + assert _result(InvoiceExtraction, "invoice").values_as(Totals) == Totals(total=1080) + + +def test_values_as_exports_forecasts_as_lists() -> None: + """Should export a forecast as the list of its point forecasts.""" + + class VisitorsExtraction(BaseModel): + next: Annotated[ForecastAnswer, Forecast(min=0, max=5000, horizon=3)] + + class Visitors(BaseModel): + next: list[float] + + visitors = _result(VisitorsExtraction, "forecast_no_interval").values_as(Visitors) + + assert visitors.next == answers("forecast_no_interval")["next"]["value"] + + +def test_result_round_trips_through_json() -> None: + """Should restore an equal result from its JSON dump.""" + result = _result(InvoiceExtraction, "invoice") + + restored = Result[InvoiceExtraction].model_validate_json(result.model_dump_json()) + + assert restored == result + assert restored.values_as(Invoice) == result.values_as(Invoice) + + +def test_result_with_aliases_round_trips_through_json() -> None: + """Should restore aliased fields, which are dumped under their Clairic names.""" + + class Aliased(BaseModel): + invoice_number: TextAnswer = Field(alias="invoice.number") + total_usd: NumberAnswer[float] = Field(alias="total-usd") + + result = _result(Aliased, "options_state_text") + + restored = Result[Aliased].model_validate_json(result.model_dump_json()) + + assert restored.data.invoice_number.value == "INV-9" + assert restored == result + + +def test_usage_counts_the_state_once_per_pass() -> None: + """Should report billed input tokens covering every pass (recorded 9k-token state).""" + response = load("trunc_10k")["response"] + assert isinstance(response, dict) + + usage = Usage.model_validate(response["result"]["usage"]) + + assert usage.passes == 2 + assert usage.input_tokens == 2 * usage.state_tokens + usage.schema_tokens diff --git a/tests/typing/answer_types.py b/tests/typing/answer_types.py index 9e57845..ea38757 100644 --- a/tests/typing/answer_types.py +++ b/tests/typing/answer_types.py @@ -22,6 +22,7 @@ TextAnswer, TextListAnswer, ) +from clairic.result import Result from clairic.specs import Estimate, Forecast @@ -56,3 +57,14 @@ def check(data: Extraction) -> None: _ = data.sale.p_below # pyright: ignore _ = data.dates.spans # pyright: ignore _ = data.invoice_numbr # pyright: ignore + + +class Values(BaseModel): + total: float | None + + +def check_result(result: Result[Extraction]) -> None: + assert_type(result.data, Extraction) + assert_type(result.data.total.value, float | None) + assert_type(result.values_as(Values), Values) + assert_type(result.usage.input_tokens, int) From af167fc4d8c35c31130b182321a66d8116d744c8 Mon Sep 17 00:00:00 2001 From: Vianney Mixtur Date: Sun, 25 Oct 2026 18:12:31 +0100 Subject: [PATCH 6/9] S6 Add the sync and async Clairic clients Clairic and AsyncClairic post an extraction model to the Workers AI REST endpoint and return a Result. Credentials fall back to CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN. Cloudflare error responses map to typed exceptions carrying the status, error code and request id; transport failures map to APIConnectionError and APITimeoutError; a truncated result emits ClairicTruncationWarning at the caller. Invalid models and empty states fail before any request. The package now exports its public API, and the version lives in _version.py, read by hatch and sent in the User-Agent header. Co-Authored-By: Claude Opus 5.5 --- pyproject.toml | 5 +- src/clairic/__init__.py | 92 +++++++++ src/clairic/_client.py | 322 +++++++++++++++++++++++++++++++ src/clairic/_version.py | 1 + src/clairic/errors.py | 2 + tests/conftest.py | 6 + tests/test_client.py | 361 +++++++++++++++++++++++++++++++++++ tests/typing/answer_types.py | 12 ++ uv.lock | 1 - 9 files changed, 800 insertions(+), 2 deletions(-) create mode 100644 src/clairic/_client.py create mode 100644 src/clairic/_version.py create mode 100644 tests/conftest.py create mode 100644 tests/test_client.py diff --git a/pyproject.toml b/pyproject.toml index ceffa07..04c3c07 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "clairic" -version = "0.1.0" +dynamic = ["version"] description = "Unofficial typed Python SDK for Cloudflare's Clairic extraction model, built on Pydantic." readme = "README.md" authors = [{ name = "Vianney Mixtur", email = "vianney@consio.ai" }] @@ -38,6 +38,9 @@ dev = [ "ruff>=0.8", ] +[tool.hatch.version] +path = "src/clairic/_version.py" + [tool.hatch.build.targets.wheel] packages = ["src/clairic"] diff --git a/src/clairic/__init__.py b/src/clairic/__init__.py index 6d6116a..34a9cd3 100644 --- a/src/clairic/__init__.py +++ b/src/clairic/__init__.py @@ -6,3 +6,95 @@ See https://developers.cloudflare.com/workers-ai/models/clairic/ for the model reference. """ + +from clairic._client import AsyncClairic, Clairic +from clairic._version import __version__ +from clairic.answers import ( + Answer, + DateAnswer, + DateEstimateAnswer, + DatetimeAnswer, + DurationAnswer, + DurationUnit, + EstimateAnswer, + ForecastAnswer, + ForecastStep, + ListAnswer, + NumberAnswer, + Span, + TextAnswer, + TextListAnswer, + TimeAnswer, +) +from clairic.errors import ( + APIConnectionError, + APIError, + APITimeoutError, + AuthenticationError, + ClairicConfigurationError, + ClairicError, + ClairicTruncationWarning, + ContextWindowExceededError, + InvalidRequestError, + ModelDefinitionError, +) +from clairic.result import Result, Usage +from clairic.specs import ( + Date, + Datetime, + Duration, + Estimate, + Forecast, + Interval, + List, + Number, + Scale, + Spec, + Text, + Time, +) + +__all__ = [ + "APIConnectionError", + "APIError", + "APITimeoutError", + "Answer", + "AsyncClairic", + "AuthenticationError", + "Clairic", + "ClairicConfigurationError", + "ClairicError", + "ClairicTruncationWarning", + "ContextWindowExceededError", + "Date", + "DateAnswer", + "DateEstimateAnswer", + "Datetime", + "DatetimeAnswer", + "Duration", + "DurationAnswer", + "DurationUnit", + "Estimate", + "EstimateAnswer", + "Forecast", + "ForecastAnswer", + "ForecastStep", + "Interval", + "InvalidRequestError", + "List", + "ListAnswer", + "ModelDefinitionError", + "Number", + "NumberAnswer", + "Result", + "Scale", + "Span", + "Spec", + "Text", + "TextAnswer", + "TextListAnswer", + "Time", + "TimeAnswer", + "Usage", + "__version__", +] diff --git a/src/clairic/_client.py b/src/clairic/_client.py new file mode 100644 index 0000000..73bcd27 --- /dev/null +++ b/src/clairic/_client.py @@ -0,0 +1,322 @@ +"""Sync and async Clairic clients over the Workers AI REST API.""" + +from __future__ import annotations + +import datetime as dt +import os +import warnings +from types import TracebackType +from typing import Any, TypeVar + +import httpx +from pydantic import BaseModel, ValidationError +from typing_extensions import Self + +from clairic._compile import build_data, fields_payload +from clairic._version import __version__ +from clairic.errors import ( + APIConnectionError, + APIError, + APITimeoutError, + AuthenticationError, + ClairicConfigurationError, + ClairicTruncationWarning, + ContextWindowExceededError, + InvalidRequestError, +) +from clairic.result import Result, Usage + +M = TypeVar("M", bound=BaseModel) + +DEFAULT_BASE_URL = "https://api.cloudflare.com/client/v4" +DEFAULT_TIMEOUT = 30.0 +ACCOUNT_ID_VARIABLE = "CLOUDFLARE_ACCOUNT_ID" +API_TOKEN_VARIABLE = "CLOUDFLARE_API_TOKEN" + + +class _ClientBase: + """Request building and response parsing shared by the sync and async clients.""" + + def __init__(self, *, account_id: str | None, api_token: str | None, base_url: str) -> None: + account_id = account_id or os.environ.get(ACCOUNT_ID_VARIABLE) + api_token = api_token or os.environ.get(API_TOKEN_VARIABLE) + if not account_id: + raise ClairicConfigurationError( + f"Pass account_id or set the {ACCOUNT_ID_VARIABLE} environment variable" + ) + if not api_token: + raise ClairicConfigurationError( + f"Pass api_token or set the {API_TOKEN_VARIABLE} environment variable" + ) + self.account_id = account_id + self._api_token = api_token + self._url = f"{base_url.rstrip('/')}/accounts/{account_id}/ai/run/@cf/cloudflare/clairic" + + def __repr__(self) -> str: + return f"{type(self).__name__}(account_id={self.account_id!r})" + + def _headers(self) -> dict[str, str]: + return { + "Authorization": f"Bearer {self._api_token}", + "User-Agent": f"clairic-python/{__version__}", + } + + @staticmethod + def _body(state: str, model: type[BaseModel], reference_date: dt.date | None) -> dict[str, Any]: + fields = fields_payload(model) + if not state: + raise ValueError("state must be a non-empty text") + body: dict[str, Any] = {"model": "clairic", "state": state, "fields": fields} + if reference_date is not None: + if isinstance(reference_date, dt.datetime): + reference_date = reference_date.date() + body["reference_date"] = reference_date.isoformat() + return body + + @staticmethod + def _parse(response: httpx.Response, model: type[M]) -> Result[M]: + status_code = response.status_code + request_id = response.headers.get("cf-ai-req-id") + try: + envelope = _Envelope.model_validate_json(response.content) + except ValidationError as error: + raise APIError( + f"Unexpected response from Cloudflare: {response.text[:500]!r}", + status_code=status_code, + request_id=request_id, + ) from error + if response.is_error or not envelope.success: + raise _api_error(status_code, envelope, request_id) + + try: + result = _ResultBody.model_validate(envelope.result) + data = build_data(model, result.answers) + except ValidationError as error: + raise APIError( + f"Clairic returned answers that do not fit {model.__name__}: {error}", + status_code=status_code, + request_id=request_id, + ) from error + if result.truncated: + warnings.warn( + "Clairic truncated the input: the answers were computed on part of it", + ClairicTruncationWarning, + stacklevel=3, + ) + return Result[model]( + data=data, + usage=result.usage, + truncated=result.truncated, + model=result.model, + request_id=request_id, + ) + + +class _ErrorItem(BaseModel): + code: int | None = None + message: str = "" + + +class _Envelope(BaseModel): + """Cloudflare API response envelope.""" + + success: bool = False + errors: list[_ErrorItem] = [] + result: Any = None + + +class _ResultBody(BaseModel): + """`result` of a successful Clairic response.""" + + answers: dict[str, Any] + truncated: bool + usage: Usage + model: str + + +def _api_error(status_code: int, envelope: _Envelope, request_id: str | None) -> APIError: + first = envelope.errors[0] if envelope.errors else _ErrorItem() + message = first.message or f"HTTP {status_code}" + if status_code == 401: + error_type: type[APIError] = AuthenticationError + elif status_code == 413: + error_type = ContextWindowExceededError + elif status_code in (400, 422): + error_type = InvalidRequestError + else: + error_type = APIError + return error_type(message, status_code=status_code, code=first.code, request_id=request_id) + + +class Clairic(_ClientBase): + """Client for Cloudflare Clairic. + + Credentials default to the `CLOUDFLARE_ACCOUNT_ID` and `CLOUDFLARE_API_TOKEN` environment + variables. Close the client, or use it as a context manager, to release its connections. + + ```python + with Clairic() as clairic: + res = clairic.extract(text, InvoiceExtraction) + ``` + + Args: + account_id: str | None + Cloudflare account id. + api_token: str | None + Cloudflare API token. + base_url: str + Cloudflare API root, to route requests through a proxy. + timeout: float | httpx.Timeout + Seconds to wait for a response. Ignored when `http_client` is given. + http_client: httpx.Client | None + HTTP client to send requests with, for custom transports or proxies. The caller + closes it. + + Raises: + ClairicConfigurationError: + When the account id or the token is neither passed nor set in the environment. + """ + + def __init__( + self, + *, + account_id: str | None = None, + api_token: str | None = None, + base_url: str = DEFAULT_BASE_URL, + timeout: float | httpx.Timeout = DEFAULT_TIMEOUT, + http_client: httpx.Client | None = None, + ) -> None: + super().__init__(account_id=account_id, api_token=api_token, base_url=base_url) + self._owns_http_client = http_client is None + self._http_client = http_client or httpx.Client(timeout=timeout) + + def extract( + self, state: str, model: type[M], *, reference_date: dt.date | None = None + ) -> Result[M]: + """Extract the fields of `model` from `state`. + + Clairic answers every field in a single pass without generating text, usually in under + a second. Each field of `model` declares its Clairic type through its answer type, its + options through an `Annotated` spec, and its instructions through + `Field(description=...)`. + + Args: + state: str + Text to read, up to Clairic's 65,536-token context window. + model: type[M] + Extraction model whose fields are answer types. + reference_date: date | None + Date that anchors dates written without a year and relative computations, such + as "net 30". Set it whenever a field depends on today's date. + + Returns: + The answers in an instance of `model`, with the token usage and the request id. + + Raises: + ModelDefinitionError: + When `model` cannot be sent to Clairic, before any request. + AuthenticationError: + When Cloudflare rejects the credentials. + InvalidRequestError: + When Cloudflare rejects the request content. + ContextWindowExceededError: + When `state` is too long. + APIError: + For any other error response, or answers that do not fit `model`. + APIConnectionError: + When Cloudflare cannot be reached; `APITimeoutError` on timeout. + """ + body = self._body(state, model, reference_date) + try: + response = self._http_client.post(self._url, json=body, headers=self._headers()) + except httpx.TimeoutException as error: + raise APITimeoutError(f"Clairic did not answer in time: {error}") from error + except httpx.TransportError as error: + raise APIConnectionError(f"Could not reach Cloudflare: {error}") from error + return self._parse(response, model) + + def close(self) -> None: + """Close the HTTP connections, unless the HTTP client was passed in.""" + if self._owns_http_client: + self._http_client.close() + + def __enter__(self) -> Self: + return self + + def __exit__( + self, + exc_type: type[BaseException] | None, + exc: BaseException | None, + traceback: TracebackType | None, + ) -> None: + self.close() + + +class AsyncClairic(_ClientBase): + """Async client for Cloudflare Clairic. + + Same options and behavior as `Clairic`, with `extract` as a coroutine. + + ```python + async with AsyncClairic() as clairic: + res = await clairic.extract(text, InvoiceExtraction) + ``` + + Args: + account_id: str | None + Cloudflare account id. + api_token: str | None + Cloudflare API token. + base_url: str + Cloudflare API root, to route requests through a proxy. + timeout: float | httpx.Timeout + Seconds to wait for a response. Ignored when `http_client` is given. + http_client: httpx.AsyncClient | None + HTTP client to send requests with. The caller closes it. + + Raises: + ClairicConfigurationError: + When the account id or the token is neither passed nor set in the environment. + """ + + def __init__( + self, + *, + account_id: str | None = None, + api_token: str | None = None, + base_url: str = DEFAULT_BASE_URL, + timeout: float | httpx.Timeout = DEFAULT_TIMEOUT, + http_client: httpx.AsyncClient | None = None, + ) -> None: + super().__init__(account_id=account_id, api_token=api_token, base_url=base_url) + self._owns_http_client = http_client is None + self._http_client = http_client or httpx.AsyncClient(timeout=timeout) + + async def extract( + self, state: str, model: type[M], *, reference_date: dt.date | None = None + ) -> Result[M]: + """Extract the fields of `model` from `state`. See `Clairic.extract`.""" + body = self._body(state, model, reference_date) + try: + response = await self._http_client.post(self._url, json=body, headers=self._headers()) + except httpx.TimeoutException as error: + raise APITimeoutError(f"Clairic did not answer in time: {error}") from error + except httpx.TransportError as error: + raise APIConnectionError(f"Could not reach Cloudflare: {error}") from error + return self._parse(response, model) + + async def aclose(self) -> None: + """Close the HTTP connections, unless the HTTP client was passed in.""" + if self._owns_http_client: + await self._http_client.aclose() + + async def __aenter__(self) -> Self: + return self + + async def __aexit__( + self, + exc_type: type[BaseException] | None, + exc: BaseException | None, + traceback: TracebackType | None, + ) -> None: + await self.aclose() diff --git a/src/clairic/_version.py b/src/clairic/_version.py new file mode 100644 index 0000000..3dc1f76 --- /dev/null +++ b/src/clairic/_version.py @@ -0,0 +1 @@ +__version__ = "0.1.0" diff --git a/src/clairic/errors.py b/src/clairic/errors.py index a027ae7..ed37385 100644 --- a/src/clairic/errors.py +++ b/src/clairic/errors.py @@ -43,6 +43,8 @@ class APIError(ClairicError): Cloudflare error code, such as 3030 for a request the model rejects. request_id: str | None Workers AI request id (`cf-ai-req-id` header), to quote when contacting Cloudflare. + `None` when Cloudflare rejects the request before it reaches Workers AI, as with + authentication errors and malformed bodies. """ def __init__( diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 0000000..5c53fe0 --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,6 @@ +import pytest + + +@pytest.fixture +def anyio_backend() -> str: + return "asyncio" diff --git a/tests/test_client.py b/tests/test_client.py new file mode 100644 index 0000000..7aa2086 --- /dev/null +++ b/tests/test_client.py @@ -0,0 +1,361 @@ +import datetime as dt +import json +import warnings +from collections.abc import Callable +from typing import Annotated, Any + +import httpx +import pytest +from pydantic import BaseModel, Field +from recorded import load + +from clairic import ( + APIConnectionError, + APIError, + APITimeoutError, + AsyncClairic, + AuthenticationError, + Clairic, + ClairicConfigurationError, + ClairicTruncationWarning, + ContextWindowExceededError, + DateAnswer, + Estimate, + EstimateAnswer, + InvalidRequestError, + ModelDefinitionError, + Number, + NumberAnswer, + TextAnswer, + TextListAnswer, +) + +ACCOUNT_ID = "0123456789abcdef0123456789abcdef" +TOKEN = "test-token" +URL = f"https://api.cloudflare.com/client/v4/accounts/{ACCOUNT_ID}/ai/run/@cf/cloudflare/clairic" + + +class InvoiceExtraction(BaseModel): + invoice_number: TextAnswer + due_date: DateAnswer = Field(description="Issue date plus the net payment days") + total: Annotated[NumberAnswer[float], Number(decimals=2, unit="USD")] = Field( + description="Amount due including shipping" + ) + contacts: TextListAnswer + po_number: TextAnswer = Field(description="Purchase order number") + days_to_pay: Annotated[EstimateAnswer[int], Estimate(min=0, max=120, step=1)] = Field( + description="Days after issue until this invoice is paid" + ) + + +Handler = Callable[[httpx.Request], httpx.Response] + + +class Recorder: + """Mock transport handler replaying a recorded response and keeping the requests.""" + + def __init__(self, fixture: str, edit: Callable[[dict[str, Any]], None] | None = None): + recording = load(fixture) + self.status = recording["status"] + self.headers = recording["headers"] + self.body = recording["response"] + if edit is not None: + assert isinstance(self.body, dict) + edit(self.body) + self.requests: list[httpx.Request] = [] + + def __call__(self, request: httpx.Request) -> httpx.Response: + self.requests.append(request) + content = self.body if isinstance(self.body, str) else json.dumps(self.body) + return httpx.Response(self.status, headers=self.headers, content=content) + + +def _client(handler: Handler) -> Clairic: + return Clairic( + account_id=ACCOUNT_ID, + api_token=TOKEN, + http_client=httpx.Client(transport=httpx.MockTransport(handler)), + ) + + +def _async_client(handler: Handler) -> AsyncClairic: + return AsyncClairic( + account_id=ACCOUNT_ID, + api_token=TOKEN, + http_client=httpx.AsyncClient(transport=httpx.MockTransport(handler)), + ) + + +INVOICE_STATE = ( + "Invoice INV-2291 from Northwind Supply, issued 2026-09-02, net 30. 4 pallets at $250.00 " + "each, shipping $80.00. Contact: Dana Ruiz, Priya Shah." +) + + +def test_extract_sends_the_documented_request() -> None: + """Should post the model, state and compiled fields with bearer authentication.""" + recorder = Recorder("invoice") + + _client(recorder).extract(INVOICE_STATE, InvoiceExtraction, reference_date=dt.date(2026, 9, 2)) + + (request,) = recorder.requests + expected = load("invoice")["request"] + assert isinstance(expected, dict) + assert str(request.url) == URL + assert request.headers["Authorization"] == f"Bearer {TOKEN}" + assert request.headers["User-Agent"].startswith("clairic-python/") + assert json.loads(request.content) == {**expected, "reference_date": "2026-09-02"} + + +def test_extract_returns_typed_answers_and_metadata() -> None: + """Should return the answers in the model with usage and request id.""" + recorder = Recorder("model_full_name") + + class Total(BaseModel): + total: NumberAnswer[float] + + result = _client(recorder).extract("Total $10.", Total) + + assert result.data.total.value == 10 + assert result.usage.input_tokens == 115 + assert result.truncated is False + assert result.model == "clairic" + assert result.request_id == "21d0233d-a285-4f04-969e-1f63c84d097d" + + +def test_datetime_reference_date_is_sent_as_a_date() -> None: + """Should send only the date part of a datetime reference date.""" + recorder = Recorder("invoice") + + _client(recorder).extract( + INVOICE_STATE, InvoiceExtraction, reference_date=dt.datetime(2026, 9, 2, 15, 30) + ) + + assert json.loads(recorder.requests[0].content)["reference_date"] == "2026-09-02" + + +@pytest.mark.parametrize( + ("fixture", "error_type", "status_code", "code", "has_request_id"), + [ + ("err_bad_token", AuthenticationError, 401, 10000, False), + ("err_bad_account", AuthenticationError, 401, 10000, False), + ("err_bad_type", InvalidRequestError, 400, 5006, True), + ("err_list_no_items", InvalidRequestError, 422, 3030, True), + ("err_malformed_json", InvalidRequestError, 400, 6003, False), + ("trunc_70k", ContextWindowExceededError, 413, 5021, True), + ], +) +def test_error_responses_raise_typed_errors( + fixture: str, + error_type: type[APIError], + status_code: int, + code: int, + has_request_id: bool, +) -> None: + """Should map each recorded Cloudflare error to its exception with code and request id.""" + recorder = Recorder(fixture) + expected_message = recorder.body["errors"][0]["message"] # type: ignore[index] + + with pytest.raises(error_type) as raised: + _client(recorder).extract(INVOICE_STATE, InvoiceExtraction) + + error = raised.value + assert error.status_code == status_code + assert error.code == code + assert error.message == expected_message + assert (error.request_id is not None) is has_request_id + + +def test_unknown_error_status_raises_api_error() -> None: + """Should raise the base APIError for statuses without a dedicated exception.""" + + def handler(request: httpx.Request) -> httpx.Response: + return httpx.Response( + 503, json={"success": False, "errors": [{"code": 7000, "message": "Unavailable"}]} + ) + + with pytest.raises(APIError) as raised: + _client(handler).extract(INVOICE_STATE, InvoiceExtraction) + + assert type(raised.value) is APIError + assert raised.value.code == 7000 + + +def test_non_json_response_raises_api_error() -> None: + """Should raise APIError carrying the body when the response is not JSON.""" + + def handler(request: httpx.Request) -> httpx.Response: + return httpx.Response(502, text="Bad gateway") + + with pytest.raises(APIError, match="Bad gateway"): + _client(handler).extract(INVOICE_STATE, InvoiceExtraction) + + +def test_answers_that_do_not_fit_the_model_raise_api_error() -> None: + """Should raise APIError naming the model when an answer does not validate.""" + + class WholeTotal(BaseModel): + amount_with_tax: NumberAnswer[int] + + with pytest.raises(APIError, match="WholeTotal"): + _client(Recorder("types_present")).extract("Total $140.39", WholeTotal) + + +def test_truncated_result_emits_a_warning() -> None: + """Should warn, pointing at the caller, when Clairic reports a truncated input.""" + + def truncate(body: dict[str, Any]) -> None: + body["result"]["truncated"] = True + + with pytest.warns(ClairicTruncationWarning) as caught: + result = _client(Recorder("invoice", truncate)).extract(INVOICE_STATE, InvoiceExtraction) + + assert result.truncated is True + assert caught[0].filename == __file__ + + +def test_untruncated_result_emits_no_warning() -> None: + """Should not warn on a complete result.""" + with warnings.catch_warnings(): + warnings.simplefilter("error") + _client(Recorder("invoice")).extract(INVOICE_STATE, InvoiceExtraction) + + +def test_timeout_raises_api_timeout_error() -> None: + """Should raise APITimeoutError when Cloudflare does not answer in time.""" + + def handler(request: httpx.Request) -> httpx.Response: + raise httpx.ReadTimeout("timed out", request=request) + + with pytest.raises(APITimeoutError): + _client(handler).extract(INVOICE_STATE, InvoiceExtraction) + + +def test_connection_failure_raises_api_connection_error() -> None: + """Should raise APIConnectionError when Cloudflare cannot be reached.""" + + def handler(request: httpx.Request) -> httpx.Response: + raise httpx.ConnectError("refused", request=request) + + with pytest.raises(APIConnectionError): + _client(handler).extract(INVOICE_STATE, InvoiceExtraction) + + +def test_invalid_model_fails_before_any_request() -> None: + """Should raise ModelDefinitionError without sending a request.""" + recorder = Recorder("invoice") + + class Invalid(BaseModel): + total: float + + with pytest.raises(ModelDefinitionError): + _client(recorder).extract(INVOICE_STATE, Invalid) + + assert recorder.requests == [] + + +def test_empty_state_fails_before_any_request() -> None: + """Should reject an empty state without sending a request (err_empty_state).""" + recorder = Recorder("err_empty_state") + + with pytest.raises(ValueError, match="state"): + _client(recorder).extract("", InvoiceExtraction) + + assert recorder.requests == [] + + +def test_credentials_fall_back_to_the_environment(monkeypatch: pytest.MonkeyPatch) -> None: + """Should read the account id and token from the Cloudflare environment variables.""" + monkeypatch.setenv("CLOUDFLARE_ACCOUNT_ID", ACCOUNT_ID) + monkeypatch.setenv("CLOUDFLARE_API_TOKEN", TOKEN) + recorder = Recorder("invoice") + + Clairic(http_client=httpx.Client(transport=httpx.MockTransport(recorder))).extract( + INVOICE_STATE, InvoiceExtraction + ) + + assert str(recorder.requests[0].url) == URL + assert recorder.requests[0].headers["Authorization"] == f"Bearer {TOKEN}" + + +@pytest.mark.parametrize("missing", ["CLOUDFLARE_ACCOUNT_ID", "CLOUDFLARE_API_TOKEN"]) +def test_missing_credentials_raise_a_configuration_error( + monkeypatch: pytest.MonkeyPatch, missing: str +) -> None: + """Should name the missing environment variable.""" + monkeypatch.setenv("CLOUDFLARE_ACCOUNT_ID", ACCOUNT_ID) + monkeypatch.setenv("CLOUDFLARE_API_TOKEN", TOKEN) + monkeypatch.delenv(missing) + + with pytest.raises(ClairicConfigurationError, match=missing): + Clairic() + + +def test_repr_does_not_reveal_the_token() -> None: + """Should leave the API token out of the client representation.""" + client = Clairic(account_id=ACCOUNT_ID, api_token=TOKEN) + + assert TOKEN not in repr(client) + client.close() + + +def test_context_manager_closes_an_owned_http_client() -> None: + """Should close the HTTP client it created, and leave a passed-in one open.""" + with Clairic(account_id=ACCOUNT_ID, api_token=TOKEN) as owned: + pass + passed_in = httpx.Client() + with Clairic(account_id=ACCOUNT_ID, api_token=TOKEN, http_client=passed_in): + pass + + assert owned._http_client.is_closed # pyright: ignore[reportPrivateUsage] + assert not passed_in.is_closed + passed_in.close() + + +@pytest.mark.anyio +async def test_async_extract_returns_typed_answers() -> None: + """Should extract with the async client like with the sync one.""" + recorder = Recorder("invoice") + + async with _async_client(recorder) as client: + result = await client.extract(INVOICE_STATE, InvoiceExtraction) + + assert result.data.invoice_number.value == "INV-2291" + assert result.data.days_to_pay.p90 == 37 + assert len(recorder.requests) == 1 + + +@pytest.mark.anyio +async def test_async_error_responses_raise_typed_errors() -> None: + """Should map errors with the async client like with the sync one.""" + async with _async_client(Recorder("err_list_no_items")) as client: + with pytest.raises(InvalidRequestError) as raised: + await client.extract(INVOICE_STATE, InvoiceExtraction) + + assert raised.value.code == 3030 + + +@pytest.mark.anyio +async def test_async_timeout_raises_api_timeout_error() -> None: + """Should raise APITimeoutError with the async client.""" + + def handler(request: httpx.Request) -> httpx.Response: + raise httpx.ReadTimeout("timed out", request=request) + + async with _async_client(handler) as client: + with pytest.raises(APITimeoutError): + await client.extract(INVOICE_STATE, InvoiceExtraction) + + +@pytest.mark.anyio +async def test_async_truncated_result_emits_a_warning() -> None: + """Should warn, pointing at the caller, with the async client.""" + + def truncate(body: dict[str, Any]) -> None: + body["result"]["truncated"] = True + + async with _async_client(Recorder("invoice", truncate)) as client: + with pytest.warns(ClairicTruncationWarning) as caught: + await client.extract(INVOICE_STATE, InvoiceExtraction) + + assert caught[0].filename == __file__ diff --git a/tests/typing/answer_types.py b/tests/typing/answer_types.py index ea38757..9626b00 100644 --- a/tests/typing/answer_types.py +++ b/tests/typing/answer_types.py @@ -11,6 +11,7 @@ from pydantic import BaseModel from typing_extensions import assert_type +from clairic import AsyncClairic, Clairic from clairic.answers import ( DateEstimateAnswer, DurationAnswer, @@ -68,3 +69,14 @@ def check_result(result: Result[Extraction]) -> None: assert_type(result.data.total.value, float | None) assert_type(result.values_as(Values), Values) assert_type(result.usage.input_tokens, int) + + +def check_clients(clairic: Clairic, async_clairic: AsyncClairic) -> None: + result = clairic.extract("text", Extraction) + assert_type(result, Result[Extraction]) + assert_type(result.data.days_to_pay.p10, int) + + +async def check_async_client(async_clairic: AsyncClairic) -> None: + result = await async_clairic.extract("text", Extraction) + assert_type(result, Result[Extraction]) diff --git a/uv.lock b/uv.lock index a75c66b..e418ecc 100644 --- a/uv.lock +++ b/uv.lock @@ -36,7 +36,6 @@ wheels = [ [[package]] name = "clairic" -version = "0.1.0" source = { editable = "." } dependencies = [ { name = "httpx" }, From 6c7b9dd95faa78be0eb013b712702b3f59dded60 Mon Sep 17 00:00:00 2001 From: Vianney Mixtur Date: Sun, 25 Oct 2026 18:13:51 +0100 Subject: [PATCH 7/9] S7 Add live tests and a Clairic schema drift check tests/live extracts every field type, estimates, a forecast and an authentication error against the real API; they run with `pytest -m live` when CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN are set (a local .env is loaded) and are deselected otherwise. scripts/check_schema_drift.py diffs Cloudflare's published input and output schemas against the copies vendored in tests/fixtures/schemas; a weekly workflow runs it. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/schema-drift.yml | 15 ++ scripts/check_schema_drift.py | 50 +++++++ tests/fixtures/schemas/schema-input.json | 169 ++++++++++++++++++++++ tests/fixtures/schemas/schema-output.json | 104 +++++++++++++ tests/live/conftest.py | 29 ++++ tests/live/test_live.py | 136 +++++++++++++++++ 6 files changed, 503 insertions(+) create mode 100644 .github/workflows/schema-drift.yml create mode 100644 scripts/check_schema_drift.py create mode 100644 tests/fixtures/schemas/schema-input.json create mode 100644 tests/fixtures/schemas/schema-output.json create mode 100644 tests/live/conftest.py create mode 100644 tests/live/test_live.py diff --git a/.github/workflows/schema-drift.yml b/.github/workflows/schema-drift.yml new file mode 100644 index 0000000..3862134 --- /dev/null +++ b/.github/workflows/schema-drift.yml @@ -0,0 +1,15 @@ +name: Clairic schema drift + +on: + schedule: + - cron: "0 6 * * 1" + workflow_dispatch: + +jobs: + drift: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v6 + - run: uv sync --locked + - run: uv run python scripts/check_schema_drift.py diff --git a/scripts/check_schema_drift.py b/scripts/check_schema_drift.py new file mode 100644 index 0000000..8cdecf1 --- /dev/null +++ b/scripts/check_schema_drift.py @@ -0,0 +1,50 @@ +"""Compare Cloudflare's published Clairic schemas with the copies vendored in tests/fixtures. + +Exits with status 1 and prints a diff when a schema changed. Clairic is in preview, so a change +means the answer models or specs may need an update; refresh the vendored copy with `--update` +once the SDK matches it. +""" + +from __future__ import annotations + +import difflib +import json +import sys +from pathlib import Path + +import httpx + +SCHEMAS = Path(__file__).resolve().parent.parent / "tests" / "fixtures" / "schemas" +BASE_URL = "https://developers.cloudflare.com/workers-ai/models/clairic" + + +def _normalized(text: str) -> str: + return json.dumps(json.loads(text), indent=2, sort_keys=True) + "\n" + + +def main(update: bool) -> int: + changed = False + for name in ("schema-input.json", "schema-output.json"): + published = _normalized(httpx.get(f"{BASE_URL}/{name}", timeout=30).raise_for_status().text) + vendored_path = SCHEMAS / name + vendored = _normalized(vendored_path.read_text()) + if published == vendored: + print(f"{name}: unchanged") + continue + changed = True + print(f"{name}: changed") + sys.stdout.writelines( + difflib.unified_diff( + vendored.splitlines(keepends=True), + published.splitlines(keepends=True), + fromfile=f"vendored/{name}", + tofile=f"published/{name}", + ) + ) + if update: + vendored_path.write_text(published) + return 1 if changed and not update else 0 + + +if __name__ == "__main__": + sys.exit(main(update="--update" in sys.argv[1:])) diff --git a/tests/fixtures/schemas/schema-input.json b/tests/fixtures/schemas/schema-input.json new file mode 100644 index 0000000..c7136cc --- /dev/null +++ b/tests/fixtures/schemas/schema-input.json @@ -0,0 +1,169 @@ +{ + "properties": { + "fields": { + "additionalProperties": { + "properties": { + "decimals": { + "description": "Numbers, durations and number lists only.", + "maximum": 6, + "minimum": 0, + "type": "integer" + }, + "horizon": { + "description": "Forecast only: number of steps.", + "maximum": 64, + "minimum": 1, + "type": "integer" + }, + "instructions": { + "description": "What the field should contain.", + "type": "string" + }, + "integer": { + "description": "Numbers and durations only.", + "type": "boolean" + }, + "interval": { + "description": "Forecast only.", + "enum": [ + "step", + "minute", + "hour", + "day", + "week", + "month", + "quarter", + "year" + ], + "type": "string" + }, + "items": { + "description": "Required for list fields.", + "enum": [ + "text", + "number", + "date" + ], + "type": "string" + }, + "max": { + "description": "Required for estimate/forecast: a number, or an ISO date for date estimates." + }, + "min": { + "description": "Required for estimate/forecast: a number, or an ISO date for date estimates." + }, + "null_threshold": { + "description": "Probability of null above which the value is null (default 0.5).", + "exclusiveMinimum": 0, + "maximum": 1, + "type": "number" + }, + "scale": { + "default": "linear", + "enum": [ + "linear", + "log" + ], + "type": "string" + }, + "step": { + "description": "Estimate grid: a positive number (days for date estimates), or \"month\" / \"year\"." + }, + "type": { + "enum": [ + "text", + "number", + "date", + "time", + "datetime", + "duration", + "list", + "estimate", + "forecast" + ], + "type": "string" + }, + "unit": { + "description": "Unit label. For durations, one of seconds, minutes, hours, days, weeks, months, years (default seconds).", + "type": "string" + } + }, + "required": [ + "type" + ], + "type": "object" + }, + "description": "Required. Map of field name to a typed field spec. At least one field; no upper limit. Fields that do not fit next to the state in one 8,192-token pass are split across parallel passes.", + "minProperties": 1, + "propertyNames": { + "pattern": "^[A-Za-z_][A-Za-z0-9_.\\-]{0,63}$" + }, + "type": "object" + }, + "images": { + "description": "Optional embedded PNG, JPEG or WebP images placed before the state (max 4; 4 MiB each, 8 MiB total decoded; request body max 16 MiB). Remote URLs are not accepted.", + "items": { + "anyOf": [ + { + "pattern": "^[Dd][Aa][Tt][Aa]:", + "title": "Data URL", + "type": "string" + }, + { + "properties": { + "base64": { + "type": "string" + }, + "content_type": { + "type": "string" + } + }, + "required": [ + "content_type", + "base64" + ], + "title": "Base64 image", + "type": "object" + } + ] + }, + "maxItems": 4, + "type": "array" + }, + "model": { + "default": "clairic", + "description": "Required. The model selector: \"clairic\".", + "pattern": "^(clairic|@cf/cloudflare/clairic)$", + "type": "string" + }, + "options": { + "properties": { + "include_quantiles": { + "default": false, + "description": "Add 99 percentiles to estimates.", + "type": "boolean" + }, + "return_state_text": { + "default": false, + "description": "Return the text that spans index into.", + "type": "boolean" + } + }, + "type": "object" + }, + "reference_date": { + "description": "ISO date that anchors dates written without a year.", + "type": "string" + }, + "state": { + "default": "", + "description": "The text to read and predict from. Must be non-empty unless images are sent. Text answers are spans of this string.", + "type": "string" + } + }, + "required": [ + "model", + "fields" + ], + "type": "object" +} diff --git a/tests/fixtures/schemas/schema-output.json b/tests/fixtures/schemas/schema-output.json new file mode 100644 index 0000000..c675a9f --- /dev/null +++ b/tests/fixtures/schemas/schema-output.json @@ -0,0 +1,104 @@ +{ + "contentType": "application/json", + "properties": { + "answers": { + "additionalProperties": { + "properties": { + "confidence": { + "type": "number" + }, + "guess": {}, + "mean": {}, + "median": {}, + "p10": {}, + "p90": {}, + "p_above": { + "type": "number" + }, + "p_below": { + "type": "number" + }, + "p_null": { + "type": "number" + }, + "quantiles": { + "type": "array" + }, + "span": { + "items": { + "type": "integer" + }, + "type": "array" + }, + "spans": { + "items": { + "items": { + "type": "integer" + }, + "type": "array" + }, + "type": "array" + }, + "steps": { + "description": "Forecast only: one estimate per step.", + "type": "array" + }, + "type": { + "type": "string" + }, + "value": {} + }, + "required": [ + "type", + "value" + ], + "type": "object" + }, + "description": "One answer per field, keyed by field name. value is null when the input does not determine it.", + "type": "object" + }, + "model": { + "type": "string" + }, + "state_text": { + "type": "string" + }, + "truncated": { + "type": "boolean" + }, + "usage": { + "properties": { + "image_tokens": { + "type": "integer" + }, + "input_tokens": { + "type": "integer" + }, + "output_tokens": { + "type": "integer" + }, + "passes": { + "type": "integer" + }, + "schema_tokens": { + "type": "integer" + }, + "state_tokens": { + "type": "integer" + } + }, + "required": [ + "input_tokens", + "output_tokens" + ], + "type": "object" + } + }, + "required": [ + "model", + "answers", + "truncated", + "usage" + ], + "type": "object" +} diff --git a/tests/live/conftest.py b/tests/live/conftest.py new file mode 100644 index 0000000..05b77e4 --- /dev/null +++ b/tests/live/conftest.py @@ -0,0 +1,29 @@ +import os +from collections.abc import Iterator + +import pytest +from dotenv import load_dotenv + +from clairic import AsyncClairic, Clairic + +load_dotenv() + +pytestmark = pytest.mark.live + + +def _require_credentials() -> None: + if not (os.environ.get("CLOUDFLARE_ACCOUNT_ID") and os.environ.get("CLOUDFLARE_API_TOKEN")): + pytest.skip("set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN to run live tests") + + +@pytest.fixture +def clairic() -> Iterator[Clairic]: + _require_credentials() + with Clairic() as client: + yield client + + +@pytest.fixture +def async_clairic() -> AsyncClairic: + _require_credentials() + return AsyncClairic() diff --git a/tests/live/test_live.py b/tests/live/test_live.py new file mode 100644 index 0000000..e1b8b2c --- /dev/null +++ b/tests/live/test_live.py @@ -0,0 +1,136 @@ +"""Extractions against the real Cloudflare API. Run with `uv run pytest -m live`.""" + +import datetime as dt +from typing import Annotated + +import pytest +from pydantic import BaseModel, Field + +from clairic import ( + AsyncClairic, + AuthenticationError, + Clairic, + DateAnswer, + DateEstimateAnswer, + DatetimeAnswer, + Duration, + DurationAnswer, + Estimate, + EstimateAnswer, + Forecast, + ForecastAnswer, + ListAnswer, + Number, + NumberAnswer, + TextAnswer, + TextListAnswer, + TimeAnswer, +) + +pytestmark = pytest.mark.live + +EMAIL = ( + "Sent: Tuesday, March 3, 2026 9:14 AM\n" + "Hi, my order #A-55120 was delivered on Feb 20 at 4:30 PM. I paid $129.99 plus 8% tax. " + "The lid is cracked and one hinge is bent. The courier left it outside for about 3 hours. " + "Our meeting is booked for 2026-03-05T14:00:00. Order quantities: 2 chairs, 1 table. " + "Other deliveries arrived on 2026-01-12 and 2026-02-02." +) + + +class Claim(BaseModel): + order_id: TextAnswer = Field(description="Order number") + amount_paid: Annotated[NumberAnswer[float], Number(decimals=2, unit="USD")] = Field( + description="Total paid including tax" + ) + delivery_date: DateAnswer = Field(description="Date the order was delivered") + delivery_time: TimeAnswer = Field(description="Time of day the order was delivered") + meeting: DatetimeAnswer = Field(description="When the meeting is booked") + rain_exposure: Annotated[DurationAnswer[float], Duration(unit="hours")] = Field( + description="How long the parcel sat outside" + ) + damage: TextListAnswer = Field(description="Each kind of damage described") + quantities: ListAnswer[int] = Field(description="Quantities of each product ordered") + other_deliveries: ListAnswer[dt.date] = Field(description="Dates of other deliveries") + tracking_number: TextAnswer = Field(description="Parcel tracking number") + + +class Claimed(BaseModel): + order_id: str + delivery_date: dt.date + tracking_number: str | None + + +def test_every_single_value_and_list_type(clairic: Clairic) -> None: + """Should extract every single-value and list type from a real response.""" + result = clairic.extract(EMAIL, Claim, reference_date=dt.date(2026, 3, 3)) + data = result.data + + assert data.order_id.value is not None + assert "A-55120" in data.order_id.value + assert data.amount_paid.value == pytest.approx(140.39, abs=0.01) + assert data.delivery_date.value == dt.date(2026, 2, 20) + assert data.delivery_time.value == dt.time(16, 30) + assert data.meeting.value == dt.datetime(2026, 3, 5, 14, 0) + assert data.rain_exposure.value == pytest.approx(3) + assert data.damage.value + assert data.quantities.value == [2, 1] + assert data.other_deliveries.value == [dt.date(2026, 1, 12), dt.date(2026, 2, 2)] + assert data.tracking_number.value is None + assert result.request_id is not None + assert result.values_as(Claimed).tracking_number is None + + +class Pricing(BaseModel): + price: Annotated[ + EstimateAnswer[int], Estimate(min=50_000, max=5_000_000, step=1000, scale="log") + ] = Field(description="Likely sale price of the subject") + sale_month: Annotated[ + DateEstimateAnswer, + Estimate(min=dt.date(2026, 4, 1), max=dt.date(2027, 4, 1), step="month"), + ] = Field(description="Month the subject sells") + + +def test_numeric_and_date_estimates(clairic: Clairic) -> None: + """Should return distributions ordered from p10 to p90.""" + homes = ( + "Comparable sales, same street, 2025: 12 Oak St, 1,650 sqft, sold $402,000. " + "18 Oak St, 1,720 sqft, sold $431,000. Subject: 21 Oak St, 1,700 sqft. Listed 2026-04-01." + ) + + data = clairic.extract(homes, Pricing).data + + assert data.price.p10 <= data.price.median <= data.price.p90 + assert data.sale_month.p10 <= data.sale_month.p90 + assert data.sale_month.median.day == 1 + + +class Visitors(BaseModel): + visitors: Annotated[ForecastAnswer, Forecast(min=0, max=5000, horizon=3, interval="day")] = ( + Field(description="Visitors on each of the next days") + ) + + +def test_forecast(clairic: Clairic) -> None: + """Should return one forecast step per horizon step.""" + series = "date,visitors\n" + "\n".join(f"2026-09-{d:02d},{1000 + 10 * d}" for d in range(1, 29)) + + forecast = clairic.extract(series, Visitors).data.visitors + + assert len(forecast.value) == len(forecast.steps) == 3 + + +def test_invalid_token_raises_authentication_error() -> None: + """Should raise AuthenticationError for a token Cloudflare rejects.""" + client = Clairic(account_id="0123456789abcdef0123456789abcdef", api_token="invalid") + with client, pytest.raises(AuthenticationError): + client.extract("Total $10.", Visitors) + + +@pytest.mark.anyio +async def test_async_client(async_clairic: AsyncClairic) -> None: + """Should extract with the async client.""" + async with async_clairic as client: + result = await client.extract(EMAIL, Claim, reference_date=dt.date(2026, 3, 3)) + + assert result.data.delivery_date.value == dt.date(2026, 2, 20) From ef3026a05d495c47489f51f7ff2ab0d5157d1ea1 Mon Sep 17 00:00:00 2001 From: Vianney Mixtur Date: Sun, 25 Oct 2026 18:15:31 +0100 Subject: [PATCH 8/9] S8 Document the SDK and add the invoice example The README covers installation, credentials, declaring fields with answer types and specs, reading answers and their metadata, the values export, storing results, the async client, errors, cost per pass, and development commands. examples/invoice.py runs the reference invoice extraction end to end and replaces the former main.py. Co-Authored-By: Claude Opus 5.5 --- README.md | 157 +++++++++++++++++++++++++++++++++++++++++++- examples/invoice.py | 74 +++++++++++++++++++++ 2 files changed, 230 insertions(+), 1 deletion(-) create mode 100644 examples/invoice.py diff --git a/README.md b/README.md index 1481dde..d3ad31d 100644 --- a/README.md +++ b/README.md @@ -2,4 +2,159 @@ **Unofficial** typed Python SDK for [Cloudflare Clairic](https://developers.cloudflare.com/workers-ai/models/clairic/), the Workers AI extraction model. This project is not affiliated with or endorsed by Cloudflare. -Usage documentation lands with the first release. +Clairic reads a text and returns typed values for the fields you name: extracted, computed, estimated or forecast, each with a confidence score, a probability of absence, or a percentile range. `clairic` lets you declare those fields as a Pydantic model and get the answers back as typed Pydantic objects. + +```python +from typing import Annotated + +from pydantic import BaseModel, Field + +from clairic import Clairic, DateAnswer, Estimate, EstimateAnswer, Number, NumberAnswer, TextAnswer + + +class InvoiceExtraction(BaseModel): + invoice_number: TextAnswer + due_date: DateAnswer = Field(description="Issue date plus the net payment days") + total: Annotated[NumberAnswer[float], Number(decimals=2, unit="USD")] = Field( + description="Amount due including shipping" + ) + po_number: TextAnswer = Field(description="Purchase order number") + days_to_pay: Annotated[EstimateAnswer[int], Estimate(min=0, max=120, step=1)] = Field( + description="Days after issue until this invoice is paid" + ) + + +with Clairic() as clairic: + result = clairic.extract( + "Invoice INV-2291 from Northwind Supply, issued 2026-09-02, net 30. " + "4 pallets at $250.00 each, shipping $80.00.", + InvoiceExtraction, + ) + +result.data.total.value # 1080.0 +result.data.total.confidence # 0.99995 +result.data.po_number.value # None: the invoice has no PO number +result.data.days_to_pay.p90 # 37 +``` + +## Install + +```sh +pip install clairic +``` + +Python 3.10 or later. Dependencies: `httpx` and `pydantic` 2. + +## Credentials + +The client reads `CLOUDFLARE_ACCOUNT_ID` and `CLOUDFLARE_API_TOKEN`, or takes them as arguments: + +```python +clairic = Clairic(account_id="...", api_token="...") +``` + +Create the token in the Cloudflare dashboard with access to Workers AI. + +## Declaring fields + +Each field of the extraction model is an answer type. The answer type sets the Clairic field type; an `Annotated` spec sets its options; `Field(description=...)` gives Clairic the instructions; a Pydantic `alias` sets the field name sent to Clairic. + +| Answer type | Clairic type | Spec (options) | +|---|---|---| +| `TextAnswer` | `text`: a span of the input | `Text(unit, null_threshold)` | +| `NumberAnswer[float]`, `NumberAnswer[int]` | `number` (`int` requests whole numbers) | `Number(unit, null_threshold, decimals)` | +| `DateAnswer`, `TimeAnswer`, `DatetimeAnswer` | `date`, `time`, `datetime` | `Date(null_threshold)`, `Time(...)`, `Datetime(...)` | +| `DurationAnswer[float]`, `DurationAnswer[int]` | `duration` | `Duration(unit, null_threshold, decimals)`, unit defaults to seconds | +| `TextListAnswer` | `list` of text spans | `List(unit, decimals)` | +| `ListAnswer[int]`, `ListAnswer[float]`, `ListAnswer[date]` | `list` of numbers or dates | `List(unit, decimals)` | +| `EstimateAnswer[int]`, `EstimateAnswer[float]` | `estimate` with number bounds | `Estimate(min, max, step, scale, unit)`, required | +| `DateEstimateAnswer` | `estimate` with date bounds | `Estimate(min=date, max=date, step="month")`, required | +| `ForecastAnswer` | `forecast` of a series | `Forecast(min, max, horizon, interval, step, scale, unit)`, required | + +Invalid declarations fail before any request: a non-answer annotation, a missing or mismatched spec, or an option Clairic rejects (such as `decimals=7` or `scale="log"` with `min=0`) raises `ModelDefinitionError` or `ValueError` naming the problem. + +Set `reference_date` whenever a field depends on today's date or on dates written without a year: + +```python +clairic.extract(text, InvoiceExtraction, reference_date=date(2026, 9, 2)) +``` + +## Reading answers + +Every answer holds a `value` and the metadata Clairic attaches to it. Your editor completes the attributes, and a type checker knows their types. + +- **Single values** (`text`, `number`, `date`, `time`, `datetime`, `duration`): `value`, `guess`, `confidence`, `p_null`. `value` is `None` when `p_null` exceeds the field's `null_threshold` (0.5 by default); `guess` still shows the best candidate. +- **Text**: `span`, end-exclusive offsets into the input: `text[span.start:span.end]`. Text lists carry `spans`. +- **Number and date lists**: `confidences`, one per item. +- **Estimates**: `value` (the mean rounded to the `step` grid), `mean`, `median`, `p10`, `p90`, and for number bounds `p_below` and `p_above`, the probability mass outside `[min, max]`. +- **Forecasts**: per-step lists `value`, `median`, `p10`, `p90`, and `steps` with the full estimate of each step. + +The p10 to p90 range is an 80% interval. Cloudflare measures its calibration but does not guarantee it, and intervals can be too narrow on unfamiliar data. Use `confidence`, `p_null` and the interval to decide which answers to act on and which to review. + +## Plain values + +`values_as` copies each answer value into the same-named field of a plain Pydantic model, ready for the rest of your program: + +```python +class Invoice(BaseModel): + invoice_number: str + total: float + po_number: str | None + days_to_pay: int + + +invoice = result.values_as(Invoice) +``` + +Pydantic validates the values, so a `None` landing in a field that does not accept `None` raises `ValidationError`. + +## Storing results + +A `Result` serializes to JSON and back with its answers, token usage and request id: + +```python +stored = result.model_dump_json() +result = Result[InvoiceExtraction].model_validate_json(stored) +``` + +## Async + +```python +from clairic import AsyncClairic + +async with AsyncClairic() as clairic: + result = await clairic.extract(text, InvoiceExtraction) +``` + +## Errors + +| Exception | When | +|---|---| +| `ModelDefinitionError` | The extraction model cannot be sent to Clairic. Raised before any request. | +| `ClairicConfigurationError` | The account id or token is missing. | +| `AuthenticationError` | HTTP 401: invalid token or unknown account. | +| `InvalidRequestError` | HTTP 400 or 422: Cloudflare rejected the request content. | +| `ContextWindowExceededError` | HTTP 413: the input exceeds the 65,536-token context window. | +| `APIError` | Any other error response, or answers that do not fit the model. Base class of the API errors. | +| `APIConnectionError`, `APITimeoutError` | Cloudflare could not be reached, or did not answer within the timeout (30 seconds by default). | + +API errors carry `status_code`, the Cloudflare error `code`, `message` and `request_id`. When Clairic reports a truncated input, the client emits `ClairicTruncationWarning` and sets `result.truncated`. + +## Cost + +Clairic bills input tokens only ($0.10 per million at the time of writing). Fields that do not fit next to the input in one 8,192-token pass are split across parallel passes, and each pass reads the whole input, so `result.usage.input_tokens` counts the input once per pass. + +## Development + +```sh +uv sync +uv run ruff format --check && uv run ruff check && uv run pyright && uv run pytest +uv run pytest -m live # real API, needs credentials +uv run python scripts/check_schema_drift.py # compare Cloudflare's schemas with the vendored ones +``` + +`examples/invoice.py` runs the invoice extraction end to end. + +## License and attribution + +MIT. Docstrings adapt text from the Cloudflare documentation, published under CC BY 4.0; see `NOTICE`. diff --git a/examples/invoice.py b/examples/invoice.py new file mode 100644 index 0000000..1ea1db4 --- /dev/null +++ b/examples/invoice.py @@ -0,0 +1,74 @@ +"""Extract an invoice with Clairic, then hand plain values to the rest of the program. + +Run with `uv run python examples/invoice.py` after setting CLOUDFLARE_ACCOUNT_ID and +CLOUDFLARE_API_TOKEN (a local .env file works). +""" + +import datetime as dt +from typing import Annotated + +from dotenv import load_dotenv +from pydantic import BaseModel, Field + +from clairic import ( + Clairic, + DateAnswer, + Estimate, + EstimateAnswer, + Number, + NumberAnswer, + TextAnswer, + TextListAnswer, +) + +INVOICE = ( + "Invoice INV-2291 from Northwind Supply, issued 2026-09-02, net 30. 4 pallets at $250.00 " + "each, shipping $80.00. Contact: Dana Ruiz, Priya Shah." +) + + +class InvoiceExtraction(BaseModel): + """What to extract, and how: each field is a Clairic answer.""" + + invoice_number: TextAnswer + due_date: DateAnswer = Field(description="Issue date plus the net payment days") + total: Annotated[NumberAnswer[float], Number(decimals=2, unit="USD")] = Field( + description="Amount due including shipping" + ) + contacts: TextListAnswer + po_number: TextAnswer = Field(description="Purchase order number") + days_to_pay: Annotated[EstimateAnswer[int], Estimate(min=0, max=120, step=1)] = Field( + description="Days after issue until this invoice is paid" + ) + + +class Invoice(BaseModel): + """The plain domain object the rest of the program works with.""" + + invoice_number: str + due_date: dt.date + total: float + contacts: list[str] + po_number: str | None + days_to_pay: int + + +def main() -> None: + load_dotenv() + with Clairic() as clairic: + result = clairic.extract(INVOICE, InvoiceExtraction, reference_date=dt.date(2026, 9, 2)) + + data = result.data + number, po, estimate = data.invoice_number, data.po_number, data.days_to_pay + print(f"Invoice number: {number.value} (confidence {number.confidence:.4f})") + print(f"Due date: {data.due_date.value}") + print(f"Total: {data.total.value} USD") + print(f"PO number: {po.value} (p_null {po.p_null:.4f}, best guess {po.guess!r})") + print(f"Days to pay: {estimate.value} (80% interval {estimate.p10} to {estimate.p90})") + print(f"Input tokens: {result.usage.input_tokens} over {result.usage.passes} passes") + print() + print(result.values_as(Invoice)) + + +if __name__ == "__main__": + main() From 033ee3493cd7f276fd694dfa0be4746d06d71708 Mon Sep 17 00:00:00 2001 From: Vianney Mixtur Date: Sun, 25 Oct 2026 23:34:10 +0100 Subject: [PATCH 9/9] Prepare the 0.1.0 release metadata Add the repository, issues and Clairic reference links shown on the PyPI project page, and run CI on pushes to version branches (v*), where each release line lives. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 2 +- pyproject.toml | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 94d5f68..2066df8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,7 +2,7 @@ name: CI on: push: - branches: [main] + branches: [main, "v*"] pull_request: jobs: diff --git a/pyproject.toml b/pyproject.toml index 04c3c07..e2a462f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,6 +29,12 @@ dependencies = [ "typing-extensions>=4.12", ] +[project.urls] +Homepage = "https://github.com/VianneyMI/clairic" +Repository = "https://github.com/VianneyMI/clairic" +Issues = "https://github.com/VianneyMI/clairic/issues" +"Clairic model reference" = "https://developers.cloudflare.com/workers-ai/models/clairic/" + [dependency-groups] dev = [ "anyio>=4.4",