From c8d58b0732e7ebede921f3b642d3705eb8e7770e Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Thu, 7 Mar 2024 21:56:47 +0000 Subject: [PATCH] Release v0.2.17 --- .github/workflows/ci.yml | 6 +- poetry.lock | 426 ++++----- pyproject.toml | 9 +- src/superagent/client.py | 46 + src/superagent/core/__init__.py | 8 + src/superagent/core/client_wrapper.py | 8 +- src/superagent/core/file.py | 38 + src/superagent/core/http_client.py | 125 +++ src/superagent/core/request_options.py | 32 + src/superagent/resources/agent/client.py | 863 +++++++++++++++--- src/superagent/resources/api_key/client.py | 226 ++++- src/superagent/resources/api_user/client.py | 218 ++++- src/superagent/resources/datasource/client.py | 329 ++++++- src/superagent/resources/llm/client.py | 226 ++++- src/superagent/resources/tool/client.py | 305 ++++++- .../resources/vector_database/client.py | 244 ++++- src/superagent/resources/workflow/client.py | 587 ++++++++++-- .../resources/workflow_config/client.py | 111 ++- .../types/agent_datasosurce_list.py | 2 +- src/superagent/types/agent_list.py | 2 +- src/superagent/types/agent_tool_list.py | 2 +- src/superagent/types/api_key_create.py | 2 +- src/superagent/types/api_key_create_model.py | 2 +- src/superagent/types/api_key_list.py | 2 +- .../types/app_models_request_api_user.py | 8 +- .../types/app_models_request_datasource.py | 10 +- .../types/app_models_request_llm.py | 2 +- .../types/app_models_response_agent.py | 2 +- .../types/app_models_response_agent_invoke.py | 2 +- .../types/app_models_response_api_key.py | 2 +- .../types/app_models_response_api_user.py | 2 +- .../types/app_models_response_datasource.py | 2 +- .../types/app_models_response_llm.py | 2 +- .../types/app_models_response_tool.py | 2 +- .../types/app_models_response_vector_db.py | 2 +- .../types/app_models_response_workflow.py | 2 +- .../app_models_response_workflow_step.py | 2 +- src/superagent/types/datasource_list.py | 2 +- src/superagent/types/function_definition.py | 6 +- src/superagent/types/http_validation_error.py | 2 +- src/superagent/types/llm_list.py | 2 +- src/superagent/types/llm_params.py | 4 +- .../types/open_ai_assistant_parameters.py | 6 +- ...open_ai_assistant_parameters_tools_item.py | 8 +- src/superagent/types/prisma_models_agent.py | 22 +- .../types/prisma_models_agent_datasource.py | 4 +- .../types/prisma_models_agent_llm.py | 4 +- .../types/prisma_models_agent_tool.py | 4 +- src/superagent/types/prisma_models_api_key.py | 2 +- .../types/prisma_models_api_user.py | 22 +- .../types/prisma_models_datasource.py | 16 +- src/superagent/types/prisma_models_llm.py | 6 +- src/superagent/types/prisma_models_tool.py | 8 +- .../types/prisma_models_vector_db.py | 6 +- .../types/prisma_models_workflow.py | 10 +- .../types/prisma_models_workflow_step.py | 8 +- .../types/tool_assistant_tools_function.py | 2 +- src/superagent/types/tool_list.py | 2 +- src/superagent/types/vector_db_list.py | 2 +- src/superagent/types/workflow_config.py | 8 +- src/superagent/types/workflow_list.py | 2 +- src/superagent/types/workflow_step_list.py | 2 +- 62 files changed, 3219 insertions(+), 800 deletions(-) create mode 100644 src/superagent/core/file.py create mode 100644 src/superagent/core/http_client.py create mode 100644 src/superagent/core/request_options.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0a5b56e..0b26bf2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: - name: Set up python uses: actions/setup-python@v4 with: - python-version: 3.7 + python-version: 3.8 - name: Bootstrap poetry run: | curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 @@ -26,7 +26,7 @@ jobs: - name: Set up python uses: actions/setup-python@v4 with: - python-version: 3.7 + python-version: 3.8 - name: Bootstrap poetry run: | curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 @@ -45,7 +45,7 @@ jobs: - name: Set up python uses: actions/setup-python@v4 with: - python-version: 3.7 + python-version: 3.8 - name: Bootstrap poetry run: | curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 diff --git a/poetry.lock b/poetry.lock index e58b434..970e278 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,14 +1,14 @@ -# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. [[package]] name = "annotated-types" -version = "0.5.0" +version = "0.6.0" description = "Reusable constraint types to use with typing.Annotated" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "annotated_types-0.5.0-py3-none-any.whl", hash = "sha256:58da39888f92c276ad970249761ebea80ba544b77acddaa1a4d6cf78287d45fd"}, - {file = "annotated_types-0.5.0.tar.gz", hash = "sha256:47cdc3490d9ac1506ce92c7aaa76c579dc3509ff11e098fc867e5130ab7be802"}, + {file = "annotated_types-0.6.0-py3-none-any.whl", hash = "sha256:0641064de18ba7a25dee8f96403ebc39113d0cb953a01429249d5c7564666a43"}, + {file = "annotated_types-0.6.0.tar.gz", hash = "sha256:563339e807e53ffd9c267e99fc6d9ea23eb8443c08f112651963e24e22f84a5d"}, ] [package.dependencies] @@ -16,25 +16,25 @@ typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.9\""} [[package]] name = "anyio" -version = "3.7.1" +version = "4.3.0" description = "High level compatibility layer for multiple asynchronous event loop implementations" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "anyio-3.7.1-py3-none-any.whl", hash = "sha256:91dee416e570e92c64041bd18b900d1d6fa78dff7048769ce5ac5ddad004fbb5"}, - {file = "anyio-3.7.1.tar.gz", hash = "sha256:44a3c9aba0f5defa43261a8b3efb97891f2bd7d804e0e1f56419befa1adfc780"}, + {file = "anyio-4.3.0-py3-none-any.whl", hash = "sha256:048e05d0f6caeed70d731f3db756d35dcc1f35747c8c403364a8332c630441b8"}, + {file = "anyio-4.3.0.tar.gz", hash = "sha256:f75253795a87df48568485fd18cdd2a3fa5c4f7c5be8e5e36637733fce06fed6"}, ] [package.dependencies] -exceptiongroup = {version = "*", markers = "python_version < \"3.11\""} +exceptiongroup = {version = ">=1.0.2", markers = "python_version < \"3.11\""} idna = ">=2.8" sniffio = ">=1.1" -typing-extensions = {version = "*", markers = "python_version < \"3.8\""} +typing-extensions = {version = ">=4.1", markers = "python_version < \"3.11\""} [package.extras] -doc = ["Sphinx", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphinx-rtd-theme (>=1.2.2)", "sphinxcontrib-jquery"] -test = ["anyio[trio]", "coverage[toml] (>=4.5)", "hypothesis (>=4.0)", "mock (>=4)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "uvloop (>=0.17)"] -trio = ["trio (<0.22)"] +doc = ["Sphinx (>=7)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphinx-rtd-theme"] +test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "uvloop (>=0.17)"] +trio = ["trio (>=0.23)"] [[package]] name = "certifi" @@ -83,44 +83,42 @@ files = [ {file = "h11-0.14.0.tar.gz", hash = "sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d"}, ] -[package.dependencies] -typing-extensions = {version = "*", markers = "python_version < \"3.8\""} - [[package]] name = "httpcore" -version = "0.17.3" +version = "1.0.4" description = "A minimal low-level HTTP client." optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "httpcore-0.17.3-py3-none-any.whl", hash = "sha256:c2789b767ddddfa2a5782e3199b2b7f6894540b17b16ec26b2c4d8e103510b87"}, - {file = "httpcore-0.17.3.tar.gz", hash = "sha256:a6f30213335e34c1ade7be6ec7c47f19f50c56db36abef1a9dfa3815b1cb3888"}, + {file = "httpcore-1.0.4-py3-none-any.whl", hash = "sha256:ac418c1db41bade2ad53ae2f3834a3a0f5ae76b56cf5aa497d2d033384fc7d73"}, + {file = "httpcore-1.0.4.tar.gz", hash = "sha256:cb2839ccfcba0d2d3c1131d3c3e26dfc327326fbe7a5dc0dbfe9f6c9151bb022"}, ] [package.dependencies] -anyio = ">=3.0,<5.0" certifi = "*" h11 = ">=0.13,<0.15" -sniffio = "==1.*" [package.extras] +asyncio = ["anyio (>=4.0,<5.0)"] http2 = ["h2 (>=3,<5)"] socks = ["socksio (==1.*)"] +trio = ["trio (>=0.22.0,<0.25.0)"] [[package]] name = "httpx" -version = "0.24.1" +version = "0.27.0" description = "The next generation HTTP client." optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "httpx-0.24.1-py3-none-any.whl", hash = "sha256:06781eb9ac53cde990577af654bd990a4949de37a28bdb4a230d434f3a30b9bd"}, - {file = "httpx-0.24.1.tar.gz", hash = "sha256:5853a43053df830c20f8110c5e69fe44d035d850b2dfe795e196f00fdb774bdd"}, + {file = "httpx-0.27.0-py3-none-any.whl", hash = "sha256:71d5465162c13681bff01ad59b2cc68dd838ea1f10e51574bac27103f00c91a5"}, + {file = "httpx-0.27.0.tar.gz", hash = "sha256:a0cb88a46f32dc874e04ee956e4c2764aba2aa228f650b06788ba6bda2962ab5"}, ] [package.dependencies] +anyio = "*" certifi = "*" -httpcore = ">=0.15.0,<0.18.0" +httpcore = "==1.*" idna = "*" sniffio = "*" @@ -141,26 +139,6 @@ files = [ {file = "idna-3.6.tar.gz", hash = "sha256:9ecdbbd083b06798ae1e86adcbfe8ab1479cf864e4ee30fe4e46a003d12491ca"}, ] -[[package]] -name = "importlib-metadata" -version = "6.7.0" -description = "Read metadata from Python packages" -optional = false -python-versions = ">=3.7" -files = [ - {file = "importlib_metadata-6.7.0-py3-none-any.whl", hash = "sha256:cb52082e659e97afc5dac71e79de97d8681de3aa07ff18578330904a9d18e5b5"}, - {file = "importlib_metadata-6.7.0.tar.gz", hash = "sha256:1aaf550d4f73e5d6783e7acb77aec43d49da8017410afae93822cc9cca98c4d4"}, -] - -[package.dependencies] -typing-extensions = {version = ">=3.6.4", markers = "python_version < \"3.8\""} -zipp = ">=0.5" - -[package.extras] -docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] -perf = ["ipython"] -testing = ["flufl.flake8", "importlib-resources (>=1.3)", "packaging", "pyfakefs", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-mypy (>=0.9.1)", "pytest-perf (>=0.9.2)", "pytest-ruff"] - [[package]] name = "iniconfig" version = "2.0.0" @@ -174,45 +152,49 @@ files = [ [[package]] name = "mypy" -version = "0.971" +version = "1.8.0" description = "Optional static typing for Python" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "mypy-0.971-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:f2899a3cbd394da157194f913a931edfd4be5f274a88041c9dc2d9cdcb1c315c"}, - {file = "mypy-0.971-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:98e02d56ebe93981c41211c05adb630d1d26c14195d04d95e49cd97dbc046dc5"}, - {file = "mypy-0.971-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:19830b7dba7d5356d3e26e2427a2ec91c994cd92d983142cbd025ebe81d69cf3"}, - {file = "mypy-0.971-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:02ef476f6dcb86e6f502ae39a16b93285fef97e7f1ff22932b657d1ef1f28655"}, - {file = "mypy-0.971-cp310-cp310-win_amd64.whl", hash = "sha256:25c5750ba5609a0c7550b73a33deb314ecfb559c350bb050b655505e8aed4103"}, - {file = "mypy-0.971-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:d3348e7eb2eea2472db611486846742d5d52d1290576de99d59edeb7cd4a42ca"}, - {file = "mypy-0.971-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:3fa7a477b9900be9b7dd4bab30a12759e5abe9586574ceb944bc29cddf8f0417"}, - {file = "mypy-0.971-cp36-cp36m-win_amd64.whl", hash = "sha256:2ad53cf9c3adc43cf3bea0a7d01a2f2e86db9fe7596dfecb4496a5dda63cbb09"}, - {file = "mypy-0.971-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:855048b6feb6dfe09d3353466004490b1872887150c5bb5caad7838b57328cc8"}, - {file = "mypy-0.971-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:23488a14a83bca6e54402c2e6435467a4138785df93ec85aeff64c6170077fb0"}, - {file = "mypy-0.971-cp37-cp37m-win_amd64.whl", hash = "sha256:4b21e5b1a70dfb972490035128f305c39bc4bc253f34e96a4adf9127cf943eb2"}, - {file = "mypy-0.971-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:9796a2ba7b4b538649caa5cecd398d873f4022ed2333ffde58eaf604c4d2cb27"}, - {file = "mypy-0.971-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:5a361d92635ad4ada1b1b2d3630fc2f53f2127d51cf2def9db83cba32e47c856"}, - {file = "mypy-0.971-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:b793b899f7cf563b1e7044a5c97361196b938e92f0a4343a5d27966a53d2ec71"}, - {file = "mypy-0.971-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:d1ea5d12c8e2d266b5fb8c7a5d2e9c0219fedfeb493b7ed60cd350322384ac27"}, - {file = "mypy-0.971-cp38-cp38-win_amd64.whl", hash = "sha256:23c7ff43fff4b0df93a186581885c8512bc50fc4d4910e0f838e35d6bb6b5e58"}, - {file = "mypy-0.971-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:1f7656b69974a6933e987ee8ffb951d836272d6c0f81d727f1d0e2696074d9e6"}, - {file = "mypy-0.971-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:d2022bfadb7a5c2ef410d6a7c9763188afdb7f3533f22a0a32be10d571ee4bbe"}, - {file = "mypy-0.971-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ef943c72a786b0f8d90fd76e9b39ce81fb7171172daf84bf43eaf937e9f220a9"}, - {file = "mypy-0.971-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:d744f72eb39f69312bc6c2abf8ff6656973120e2eb3f3ec4f758ed47e414a4bf"}, - {file = "mypy-0.971-cp39-cp39-win_amd64.whl", hash = "sha256:77a514ea15d3007d33a9e2157b0ba9c267496acf12a7f2b9b9f8446337aac5b0"}, - {file = "mypy-0.971-py3-none-any.whl", hash = "sha256:0d054ef16b071149917085f51f89555a576e2618d5d9dd70bd6eea6410af3ac9"}, - {file = "mypy-0.971.tar.gz", hash = "sha256:40b0f21484238269ae6a57200c807d80debc6459d444c0489a102d7c6a75fa56"}, + {file = "mypy-1.8.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:485a8942f671120f76afffff70f259e1cd0f0cfe08f81c05d8816d958d4577d3"}, + {file = "mypy-1.8.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:df9824ac11deaf007443e7ed2a4a26bebff98d2bc43c6da21b2b64185da011c4"}, + {file = "mypy-1.8.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2afecd6354bbfb6e0160f4e4ad9ba6e4e003b767dd80d85516e71f2e955ab50d"}, + {file = "mypy-1.8.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:8963b83d53ee733a6e4196954502b33567ad07dfd74851f32be18eb932fb1cb9"}, + {file = "mypy-1.8.0-cp310-cp310-win_amd64.whl", hash = "sha256:e46f44b54ebddbeedbd3d5b289a893219065ef805d95094d16a0af6630f5d410"}, + {file = "mypy-1.8.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:855fe27b80375e5c5878492f0729540db47b186509c98dae341254c8f45f42ae"}, + {file = "mypy-1.8.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:4c886c6cce2d070bd7df4ec4a05a13ee20c0aa60cb587e8d1265b6c03cf91da3"}, + {file = "mypy-1.8.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d19c413b3c07cbecf1f991e2221746b0d2a9410b59cb3f4fb9557f0365a1a817"}, + {file = "mypy-1.8.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:9261ed810972061388918c83c3f5cd46079d875026ba97380f3e3978a72f503d"}, + {file = "mypy-1.8.0-cp311-cp311-win_amd64.whl", hash = "sha256:51720c776d148bad2372ca21ca29256ed483aa9a4cdefefcef49006dff2a6835"}, + {file = "mypy-1.8.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:52825b01f5c4c1c4eb0db253ec09c7aa17e1a7304d247c48b6f3599ef40db8bd"}, + {file = "mypy-1.8.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f5ac9a4eeb1ec0f1ccdc6f326bcdb464de5f80eb07fb38b5ddd7b0de6bc61e55"}, + {file = "mypy-1.8.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:afe3fe972c645b4632c563d3f3eff1cdca2fa058f730df2b93a35e3b0c538218"}, + {file = "mypy-1.8.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:42c6680d256ab35637ef88891c6bd02514ccb7e1122133ac96055ff458f93fc3"}, + {file = "mypy-1.8.0-cp312-cp312-win_amd64.whl", hash = "sha256:720a5ca70e136b675af3af63db533c1c8c9181314d207568bbe79051f122669e"}, + {file = "mypy-1.8.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:028cf9f2cae89e202d7b6593cd98db6759379f17a319b5faf4f9978d7084cdc6"}, + {file = "mypy-1.8.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:4e6d97288757e1ddba10dd9549ac27982e3e74a49d8d0179fc14d4365c7add66"}, + {file = "mypy-1.8.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7f1478736fcebb90f97e40aff11a5f253af890c845ee0c850fe80aa060a267c6"}, + {file = "mypy-1.8.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:42419861b43e6962a649068a61f4a4839205a3ef525b858377a960b9e2de6e0d"}, + {file = "mypy-1.8.0-cp38-cp38-win_amd64.whl", hash = "sha256:2b5b6c721bd4aabaadead3a5e6fa85c11c6c795e0c81a7215776ef8afc66de02"}, + {file = "mypy-1.8.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:5c1538c38584029352878a0466f03a8ee7547d7bd9f641f57a0f3017a7c905b8"}, + {file = "mypy-1.8.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:4ef4be7baf08a203170f29e89d79064463b7fc7a0908b9d0d5114e8009c3a259"}, + {file = "mypy-1.8.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7178def594014aa6c35a8ff411cf37d682f428b3b5617ca79029d8ae72f5402b"}, + {file = "mypy-1.8.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:ab3c84fa13c04aeeeabb2a7f67a25ef5d77ac9d6486ff33ded762ef353aa5592"}, + {file = "mypy-1.8.0-cp39-cp39-win_amd64.whl", hash = "sha256:99b00bc72855812a60d253420d8a2eae839b0afa4938f09f4d2aa9bb4654263a"}, + {file = "mypy-1.8.0-py3-none-any.whl", hash = "sha256:538fd81bb5e430cc1381a443971c0475582ff9f434c16cd46d2c66763ce85d9d"}, + {file = "mypy-1.8.0.tar.gz", hash = "sha256:6ff8b244d7085a0b425b56d327b480c3b29cafbd2eff27316a004f9a7391ae07"}, ] [package.dependencies] -mypy-extensions = ">=0.4.3" +mypy-extensions = ">=1.0.0" tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} -typed-ast = {version = ">=1.4.0,<2", markers = "python_version < \"3.8\""} -typing-extensions = ">=3.10" +typing-extensions = ">=4.1.0" [package.extras] dmypy = ["psutil (>=4.0)"] -python2 = ["typed-ast (>=1.4.0,<2)"] +install-types = ["pip"] +mypyc = ["setuptools (>=50)"] reports = ["lxml"] [[package]] @@ -239,36 +221,33 @@ files = [ [[package]] name = "pluggy" -version = "1.2.0" +version = "1.4.0" description = "plugin and hook calling mechanisms for python" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "pluggy-1.2.0-py3-none-any.whl", hash = "sha256:c2fd55a7d7a3863cba1a013e4e2414658b1d07b6bc57b3919e0c63c9abb99849"}, - {file = "pluggy-1.2.0.tar.gz", hash = "sha256:d12f0c4b579b15f5e054301bb226ee85eeeba08ffec228092f8defbaa3a4c4b3"}, + {file = "pluggy-1.4.0-py3-none-any.whl", hash = "sha256:7db9f7b503d67d1c5b95f59773ebb58a8c1c288129a88665838012cfb07b8981"}, + {file = "pluggy-1.4.0.tar.gz", hash = "sha256:8c85c2876142a764e5b7548e7d9a0e0ddb46f5185161049a79b7e974454223be"}, ] -[package.dependencies] -importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} - [package.extras] dev = ["pre-commit", "tox"] testing = ["pytest", "pytest-benchmark"] [[package]] name = "pydantic" -version = "2.4.2" +version = "2.6.3" description = "Data validation using Python type hints" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "pydantic-2.4.2-py3-none-any.whl", hash = "sha256:bc3ddf669d234f4220e6e1c4d96b061abe0998185a8d7855c0126782b7abc8c1"}, - {file = "pydantic-2.4.2.tar.gz", hash = "sha256:94f336138093a5d7f426aac732dcfe7ab4eb4da243c88f891d65deb4a2556ee7"}, + {file = "pydantic-2.6.3-py3-none-any.whl", hash = "sha256:72c6034df47f46ccdf81869fddb81aade68056003900a8724a4f160700016a2a"}, + {file = "pydantic-2.6.3.tar.gz", hash = "sha256:e07805c4c7f5c6826e33a1d4c9d47950d7eaf34868e2690f8594d2e30241f11f"}, ] [package.dependencies] annotated-types = ">=0.4.0" -pydantic-core = "2.10.1" +pydantic-core = "2.16.3" typing-extensions = ">=4.6.1" [package.extras] @@ -276,117 +255,90 @@ email = ["email-validator (>=2.0.0)"] [[package]] name = "pydantic-core" -version = "2.10.1" +version = "2.16.3" description = "" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "pydantic_core-2.10.1-cp310-cp310-macosx_10_7_x86_64.whl", hash = "sha256:d64728ee14e667ba27c66314b7d880b8eeb050e58ffc5fec3b7a109f8cddbd63"}, - {file = "pydantic_core-2.10.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:48525933fea744a3e7464c19bfede85df4aba79ce90c60b94d8b6e1eddd67096"}, - {file = "pydantic_core-2.10.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ef337945bbd76cce390d1b2496ccf9f90b1c1242a3a7bc242ca4a9fc5993427a"}, - {file = "pydantic_core-2.10.1-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:a1392e0638af203cee360495fd2cfdd6054711f2db5175b6e9c3c461b76f5175"}, - {file = "pydantic_core-2.10.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0675ba5d22de54d07bccde38997e780044dcfa9a71aac9fd7d4d7a1d2e3e65f7"}, - {file = "pydantic_core-2.10.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:128552af70a64660f21cb0eb4876cbdadf1a1f9d5de820fed6421fa8de07c893"}, - {file = "pydantic_core-2.10.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8f6e6aed5818c264412ac0598b581a002a9f050cb2637a84979859e70197aa9e"}, - {file = "pydantic_core-2.10.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ecaac27da855b8d73f92123e5f03612b04c5632fd0a476e469dfc47cd37d6b2e"}, - {file = "pydantic_core-2.10.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:b3c01c2fb081fced3bbb3da78510693dc7121bb893a1f0f5f4b48013201f362e"}, - {file = "pydantic_core-2.10.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:92f675fefa977625105708492850bcbc1182bfc3e997f8eecb866d1927c98ae6"}, - {file = "pydantic_core-2.10.1-cp310-none-win32.whl", hash = "sha256:420a692b547736a8d8703c39ea935ab5d8f0d2573f8f123b0a294e49a73f214b"}, - {file = "pydantic_core-2.10.1-cp310-none-win_amd64.whl", hash = "sha256:0880e239827b4b5b3e2ce05e6b766a7414e5f5aedc4523be6b68cfbc7f61c5d0"}, - {file = "pydantic_core-2.10.1-cp311-cp311-macosx_10_7_x86_64.whl", hash = "sha256:073d4a470b195d2b2245d0343569aac7e979d3a0dcce6c7d2af6d8a920ad0bea"}, - {file = "pydantic_core-2.10.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:600d04a7b342363058b9190d4e929a8e2e715c5682a70cc37d5ded1e0dd370b4"}, - {file = "pydantic_core-2.10.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:39215d809470f4c8d1881758575b2abfb80174a9e8daf8f33b1d4379357e417c"}, - {file = "pydantic_core-2.10.1-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:eeb3d3d6b399ffe55f9a04e09e635554012f1980696d6b0aca3e6cf42a17a03b"}, - {file = "pydantic_core-2.10.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a7a7902bf75779bc12ccfc508bfb7a4c47063f748ea3de87135d433a4cca7a2f"}, - {file = "pydantic_core-2.10.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3625578b6010c65964d177626fde80cf60d7f2e297d56b925cb5cdeda6e9925a"}, - {file = "pydantic_core-2.10.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:caa48fc31fc7243e50188197b5f0c4228956f97b954f76da157aae7f67269ae8"}, - {file = "pydantic_core-2.10.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:07ec6d7d929ae9c68f716195ce15e745b3e8fa122fc67698ac6498d802ed0fa4"}, - {file = "pydantic_core-2.10.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:e6f31a17acede6a8cd1ae2d123ce04d8cca74056c9d456075f4f6f85de055607"}, - {file = "pydantic_core-2.10.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:d8f1ebca515a03e5654f88411420fea6380fc841d1bea08effb28184e3d4899f"}, - {file = "pydantic_core-2.10.1-cp311-none-win32.whl", hash = "sha256:6db2eb9654a85ada248afa5a6db5ff1cf0f7b16043a6b070adc4a5be68c716d6"}, - {file = "pydantic_core-2.10.1-cp311-none-win_amd64.whl", hash = "sha256:4a5be350f922430997f240d25f8219f93b0c81e15f7b30b868b2fddfc2d05f27"}, - {file = "pydantic_core-2.10.1-cp311-none-win_arm64.whl", hash = "sha256:5fdb39f67c779b183b0c853cd6b45f7db84b84e0571b3ef1c89cdb1dfc367325"}, - {file = "pydantic_core-2.10.1-cp312-cp312-macosx_10_7_x86_64.whl", hash = "sha256:b1f22a9ab44de5f082216270552aa54259db20189e68fc12484873d926426921"}, - {file = "pydantic_core-2.10.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8572cadbf4cfa95fb4187775b5ade2eaa93511f07947b38f4cd67cf10783b118"}, - {file = "pydantic_core-2.10.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:db9a28c063c7c00844ae42a80203eb6d2d6bbb97070cfa00194dff40e6f545ab"}, - {file = "pydantic_core-2.10.1-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:0e2a35baa428181cb2270a15864ec6286822d3576f2ed0f4cd7f0c1708472aff"}, - {file = "pydantic_core-2.10.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:05560ab976012bf40f25d5225a58bfa649bb897b87192a36c6fef1ab132540d7"}, - {file = "pydantic_core-2.10.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d6495008733c7521a89422d7a68efa0a0122c99a5861f06020ef5b1f51f9ba7c"}, - {file = "pydantic_core-2.10.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:14ac492c686defc8e6133e3a2d9eaf5261b3df26b8ae97450c1647286750b901"}, - {file = "pydantic_core-2.10.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:8282bab177a9a3081fd3d0a0175a07a1e2bfb7fcbbd949519ea0980f8a07144d"}, - {file = "pydantic_core-2.10.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:aafdb89fdeb5fe165043896817eccd6434aee124d5ee9b354f92cd574ba5e78f"}, - {file = "pydantic_core-2.10.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:f6defd966ca3b187ec6c366604e9296f585021d922e666b99c47e78738b5666c"}, - {file = "pydantic_core-2.10.1-cp312-none-win32.whl", hash = "sha256:7c4d1894fe112b0864c1fa75dffa045720a194b227bed12f4be7f6045b25209f"}, - {file = "pydantic_core-2.10.1-cp312-none-win_amd64.whl", hash = "sha256:5994985da903d0b8a08e4935c46ed8daf5be1cf217489e673910951dc533d430"}, - {file = "pydantic_core-2.10.1-cp312-none-win_arm64.whl", hash = "sha256:0d8a8adef23d86d8eceed3e32e9cca8879c7481c183f84ed1a8edc7df073af94"}, - {file = "pydantic_core-2.10.1-cp37-cp37m-macosx_10_7_x86_64.whl", hash = "sha256:9badf8d45171d92387410b04639d73811b785b5161ecadabf056ea14d62d4ede"}, - {file = "pydantic_core-2.10.1-cp37-cp37m-macosx_11_0_arm64.whl", hash = "sha256:ebedb45b9feb7258fac0a268a3f6bec0a2ea4d9558f3d6f813f02ff3a6dc6698"}, - {file = "pydantic_core-2.10.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cfe1090245c078720d250d19cb05d67e21a9cd7c257698ef139bc41cf6c27b4f"}, - {file = "pydantic_core-2.10.1-cp37-cp37m-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e357571bb0efd65fd55f18db0a2fb0ed89d0bb1d41d906b138f088933ae618bb"}, - {file = "pydantic_core-2.10.1-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b3dcd587b69bbf54fc04ca157c2323b8911033e827fffaecf0cafa5a892a0904"}, - {file = "pydantic_core-2.10.1-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9c120c9ce3b163b985a3b966bb701114beb1da4b0468b9b236fc754783d85aa3"}, - {file = "pydantic_core-2.10.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:15d6bca84ffc966cc9976b09a18cf9543ed4d4ecbd97e7086f9ce9327ea48891"}, - {file = "pydantic_core-2.10.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:5cabb9710f09d5d2e9e2748c3e3e20d991a4c5f96ed8f1132518f54ab2967221"}, - {file = "pydantic_core-2.10.1-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:82f55187a5bebae7d81d35b1e9aaea5e169d44819789837cdd4720d768c55d15"}, - {file = "pydantic_core-2.10.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:1d40f55222b233e98e3921df7811c27567f0e1a4411b93d4c5c0f4ce131bc42f"}, - {file = "pydantic_core-2.10.1-cp37-none-win32.whl", hash = "sha256:14e09ff0b8fe6e46b93d36a878f6e4a3a98ba5303c76bb8e716f4878a3bee92c"}, - {file = "pydantic_core-2.10.1-cp37-none-win_amd64.whl", hash = "sha256:1396e81b83516b9d5c9e26a924fa69164156c148c717131f54f586485ac3c15e"}, - {file = "pydantic_core-2.10.1-cp38-cp38-macosx_10_7_x86_64.whl", hash = "sha256:6835451b57c1b467b95ffb03a38bb75b52fb4dc2762bb1d9dbed8de31ea7d0fc"}, - {file = "pydantic_core-2.10.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:b00bc4619f60c853556b35f83731bd817f989cba3e97dc792bb8c97941b8053a"}, - {file = "pydantic_core-2.10.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0fa467fd300a6f046bdb248d40cd015b21b7576c168a6bb20aa22e595c8ffcdd"}, - {file = "pydantic_core-2.10.1-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d99277877daf2efe074eae6338453a4ed54a2d93fb4678ddfe1209a0c93a2468"}, - {file = "pydantic_core-2.10.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fa7db7558607afeccb33c0e4bf1c9a9a835e26599e76af6fe2fcea45904083a6"}, - {file = "pydantic_core-2.10.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:aad7bd686363d1ce4ee930ad39f14e1673248373f4a9d74d2b9554f06199fb58"}, - {file = "pydantic_core-2.10.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:443fed67d33aa85357464f297e3d26e570267d1af6fef1c21ca50921d2976302"}, - {file = "pydantic_core-2.10.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:042462d8d6ba707fd3ce9649e7bf268633a41018d6a998fb5fbacb7e928a183e"}, - {file = "pydantic_core-2.10.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:ecdbde46235f3d560b18be0cb706c8e8ad1b965e5c13bbba7450c86064e96561"}, - {file = "pydantic_core-2.10.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:ed550ed05540c03f0e69e6d74ad58d026de61b9eaebebbaaf8873e585cbb18de"}, - {file = "pydantic_core-2.10.1-cp38-none-win32.whl", hash = "sha256:8cdbbd92154db2fec4ec973d45c565e767ddc20aa6dbaf50142676484cbff8ee"}, - {file = "pydantic_core-2.10.1-cp38-none-win_amd64.whl", hash = "sha256:9f6f3e2598604956480f6c8aa24a3384dbf6509fe995d97f6ca6103bb8c2534e"}, - {file = "pydantic_core-2.10.1-cp39-cp39-macosx_10_7_x86_64.whl", hash = "sha256:655f8f4c8d6a5963c9a0687793da37b9b681d9ad06f29438a3b2326d4e6b7970"}, - {file = "pydantic_core-2.10.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:e570ffeb2170e116a5b17e83f19911020ac79d19c96f320cbfa1fa96b470185b"}, - {file = "pydantic_core-2.10.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:64322bfa13e44c6c30c518729ef08fda6026b96d5c0be724b3c4ae4da939f875"}, - {file = "pydantic_core-2.10.1-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:485a91abe3a07c3a8d1e082ba29254eea3e2bb13cbbd4351ea4e5a21912cc9b0"}, - {file = "pydantic_core-2.10.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f7c2b8eb9fc872e68b46eeaf835e86bccc3a58ba57d0eedc109cbb14177be531"}, - {file = "pydantic_core-2.10.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a5cb87bdc2e5f620693148b5f8f842d293cae46c5f15a1b1bf7ceeed324a740c"}, - {file = "pydantic_core-2.10.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:25bd966103890ccfa028841a8f30cebcf5875eeac8c4bde4fe221364c92f0c9a"}, - {file = "pydantic_core-2.10.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f323306d0556351735b54acbf82904fe30a27b6a7147153cbe6e19aaaa2aa429"}, - {file = "pydantic_core-2.10.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:0c27f38dc4fbf07b358b2bc90edf35e82d1703e22ff2efa4af4ad5de1b3833e7"}, - {file = "pydantic_core-2.10.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:f1365e032a477c1430cfe0cf2856679529a2331426f8081172c4a74186f1d595"}, - {file = "pydantic_core-2.10.1-cp39-none-win32.whl", hash = "sha256:a1c311fd06ab3b10805abb72109f01a134019739bd3286b8ae1bc2fc4e50c07a"}, - {file = "pydantic_core-2.10.1-cp39-none-win_amd64.whl", hash = "sha256:ae8a8843b11dc0b03b57b52793e391f0122e740de3df1474814c700d2622950a"}, - {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-macosx_10_7_x86_64.whl", hash = "sha256:d43002441932f9a9ea5d6f9efaa2e21458221a3a4b417a14027a1d530201ef1b"}, - {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:fcb83175cc4936a5425dde3356f079ae03c0802bbdf8ff82c035f8a54b333521"}, - {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:962ed72424bf1f72334e2f1e61b68f16c0e596f024ca7ac5daf229f7c26e4208"}, - {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2cf5bb4dd67f20f3bbc1209ef572a259027c49e5ff694fa56bed62959b41e1f9"}, - {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:e544246b859f17373bed915182ab841b80849ed9cf23f1f07b73b7c58baee5fb"}, - {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:c0877239307b7e69d025b73774e88e86ce82f6ba6adf98f41069d5b0b78bd1bf"}, - {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:53df009d1e1ba40f696f8995683e067e3967101d4bb4ea6f667931b7d4a01357"}, - {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:a1254357f7e4c82e77c348dabf2d55f1d14d19d91ff025004775e70a6ef40ada"}, - {file = "pydantic_core-2.10.1-pp37-pypy37_pp73-macosx_10_7_x86_64.whl", hash = "sha256:524ff0ca3baea164d6d93a32c58ac79eca9f6cf713586fdc0adb66a8cdeab96a"}, - {file = "pydantic_core-2.10.1-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3f0ac9fb8608dbc6eaf17956bf623c9119b4db7dbb511650910a82e261e6600f"}, - {file = "pydantic_core-2.10.1-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:320f14bd4542a04ab23747ff2c8a778bde727158b606e2661349557f0770711e"}, - {file = "pydantic_core-2.10.1-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:63974d168b6233b4ed6a0046296803cb13c56637a7b8106564ab575926572a55"}, - {file = "pydantic_core-2.10.1-pp37-pypy37_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:417243bf599ba1f1fef2bb8c543ceb918676954734e2dcb82bf162ae9d7bd514"}, - {file = "pydantic_core-2.10.1-pp37-pypy37_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:dda81e5ec82485155a19d9624cfcca9be88a405e2857354e5b089c2a982144b2"}, - {file = "pydantic_core-2.10.1-pp37-pypy37_pp73-win_amd64.whl", hash = "sha256:14cfbb00959259e15d684505263d5a21732b31248a5dd4941f73a3be233865b9"}, - {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-macosx_10_7_x86_64.whl", hash = "sha256:631cb7415225954fdcc2a024119101946793e5923f6c4d73a5914d27eb3d3a05"}, - {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-macosx_11_0_arm64.whl", hash = "sha256:bec7dd208a4182e99c5b6c501ce0b1f49de2802448d4056091f8e630b28e9a52"}, - {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:149b8a07712f45b332faee1a2258d8ef1fb4a36f88c0c17cb687f205c5dc6e7d"}, - {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4d966c47f9dd73c2d32a809d2be529112d509321c5310ebf54076812e6ecd884"}, - {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:7eb037106f5c6b3b0b864ad226b0b7ab58157124161d48e4b30c4a43fef8bc4b"}, - {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:154ea7c52e32dce13065dbb20a4a6f0cc012b4f667ac90d648d36b12007fa9f7"}, - {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:e562617a45b5a9da5be4abe72b971d4f00bf8555eb29bb91ec2ef2be348cd132"}, - {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:f23b55eb5464468f9e0e9a9935ce3ed2a870608d5f534025cd5536bca25b1402"}, - {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-macosx_10_7_x86_64.whl", hash = "sha256:e9121b4009339b0f751955baf4543a0bfd6bc3f8188f8056b1a25a2d45099934"}, - {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:0523aeb76e03f753b58be33b26540880bac5aa54422e4462404c432230543f33"}, - {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2e0e2959ef5d5b8dc9ef21e1a305a21a36e254e6a34432d00c72a92fdc5ecda5"}, - {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:da01bec0a26befab4898ed83b362993c844b9a607a86add78604186297eb047e"}, - {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f2e9072d71c1f6cfc79a36d4484c82823c560e6f5599c43c1ca6b5cdbd54f881"}, - {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:f36a3489d9e28fe4b67be9992a23029c3cec0babc3bd9afb39f49844a8c721c5"}, - {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:f64f82cc3443149292b32387086d02a6c7fb39b8781563e0ca7b8d7d9cf72bd7"}, - {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:b4a6db486ac8e99ae696e09efc8b2b9fea67b63c8f88ba7a1a16c24a057a0776"}, - {file = "pydantic_core-2.10.1.tar.gz", hash = "sha256:0f8682dbdd2f67f8e1edddcbffcc29f60a6182b4901c367fc8c1c40d30bb0a82"}, + {file = "pydantic_core-2.16.3-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:75b81e678d1c1ede0785c7f46690621e4c6e63ccd9192af1f0bd9d504bbb6bf4"}, + {file = "pydantic_core-2.16.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9c865a7ee6f93783bd5d781af5a4c43dadc37053a5b42f7d18dc019f8c9d2bd1"}, + {file = "pydantic_core-2.16.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:162e498303d2b1c036b957a1278fa0899d02b2842f1ff901b6395104c5554a45"}, + {file = "pydantic_core-2.16.3-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:2f583bd01bbfbff4eaee0868e6fc607efdfcc2b03c1c766b06a707abbc856187"}, + {file = "pydantic_core-2.16.3-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b926dd38db1519ed3043a4de50214e0d600d404099c3392f098a7f9d75029ff8"}, + {file = "pydantic_core-2.16.3-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:716b542728d4c742353448765aa7cdaa519a7b82f9564130e2b3f6766018c9ec"}, + {file = "pydantic_core-2.16.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fc4ad7f7ee1a13d9cb49d8198cd7d7e3aa93e425f371a68235f784e99741561f"}, + {file = "pydantic_core-2.16.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:bd87f48924f360e5d1c5f770d6155ce0e7d83f7b4e10c2f9ec001c73cf475c99"}, + {file = "pydantic_core-2.16.3-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:0df446663464884297c793874573549229f9eca73b59360878f382a0fc085979"}, + {file = "pydantic_core-2.16.3-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:4df8a199d9f6afc5ae9a65f8f95ee52cae389a8c6b20163762bde0426275b7db"}, + {file = "pydantic_core-2.16.3-cp310-none-win32.whl", hash = "sha256:456855f57b413f077dff513a5a28ed838dbbb15082ba00f80750377eed23d132"}, + {file = "pydantic_core-2.16.3-cp310-none-win_amd64.whl", hash = "sha256:732da3243e1b8d3eab8c6ae23ae6a58548849d2e4a4e03a1924c8ddf71a387cb"}, + {file = "pydantic_core-2.16.3-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:519ae0312616026bf4cedc0fe459e982734f3ca82ee8c7246c19b650b60a5ee4"}, + {file = "pydantic_core-2.16.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:b3992a322a5617ded0a9f23fd06dbc1e4bd7cf39bc4ccf344b10f80af58beacd"}, + {file = "pydantic_core-2.16.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8d62da299c6ecb04df729e4b5c52dc0d53f4f8430b4492b93aa8de1f541c4aac"}, + {file = "pydantic_core-2.16.3-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:2acca2be4bb2f2147ada8cac612f8a98fc09f41c89f87add7256ad27332c2fda"}, + {file = "pydantic_core-2.16.3-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1b662180108c55dfbf1280d865b2d116633d436cfc0bba82323554873967b340"}, + {file = "pydantic_core-2.16.3-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e7c6ed0dc9d8e65f24f5824291550139fe6f37fac03788d4580da0d33bc00c97"}, + {file = "pydantic_core-2.16.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a6b1bb0827f56654b4437955555dc3aeeebeddc47c2d7ed575477f082622c49e"}, + {file = "pydantic_core-2.16.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:e56f8186d6210ac7ece503193ec84104da7ceb98f68ce18c07282fcc2452e76f"}, + {file = "pydantic_core-2.16.3-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:936e5db01dd49476fa8f4383c259b8b1303d5dd5fb34c97de194560698cc2c5e"}, + {file = "pydantic_core-2.16.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:33809aebac276089b78db106ee692bdc9044710e26f24a9a2eaa35a0f9fa70ba"}, + {file = "pydantic_core-2.16.3-cp311-none-win32.whl", hash = "sha256:ded1c35f15c9dea16ead9bffcde9bb5c7c031bff076355dc58dcb1cb436c4721"}, + {file = "pydantic_core-2.16.3-cp311-none-win_amd64.whl", hash = "sha256:d89ca19cdd0dd5f31606a9329e309d4fcbb3df860960acec32630297d61820df"}, + {file = "pydantic_core-2.16.3-cp311-none-win_arm64.whl", hash = "sha256:6162f8d2dc27ba21027f261e4fa26f8bcb3cf9784b7f9499466a311ac284b5b9"}, + {file = "pydantic_core-2.16.3-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:0f56ae86b60ea987ae8bcd6654a887238fd53d1384f9b222ac457070b7ac4cff"}, + {file = "pydantic_core-2.16.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:c9bd22a2a639e26171068f8ebb5400ce2c1bc7d17959f60a3b753ae13c632975"}, + {file = "pydantic_core-2.16.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4204e773b4b408062960e65468d5346bdfe139247ee5f1ca2a378983e11388a2"}, + {file = "pydantic_core-2.16.3-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f651dd19363c632f4abe3480a7c87a9773be27cfe1341aef06e8759599454120"}, + {file = "pydantic_core-2.16.3-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:aaf09e615a0bf98d406657e0008e4a8701b11481840be7d31755dc9f97c44053"}, + {file = "pydantic_core-2.16.3-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8e47755d8152c1ab5b55928ab422a76e2e7b22b5ed8e90a7d584268dd49e9c6b"}, + {file = "pydantic_core-2.16.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:500960cb3a0543a724a81ba859da816e8cf01b0e6aaeedf2c3775d12ee49cade"}, + {file = "pydantic_core-2.16.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:cf6204fe865da605285c34cf1172879d0314ff267b1c35ff59de7154f35fdc2e"}, + {file = "pydantic_core-2.16.3-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:d33dd21f572545649f90c38c227cc8631268ba25c460b5569abebdd0ec5974ca"}, + {file = "pydantic_core-2.16.3-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:49d5d58abd4b83fb8ce763be7794d09b2f50f10aa65c0f0c1696c677edeb7cbf"}, + {file = "pydantic_core-2.16.3-cp312-none-win32.whl", hash = "sha256:f53aace168a2a10582e570b7736cc5bef12cae9cf21775e3eafac597e8551fbe"}, + {file = "pydantic_core-2.16.3-cp312-none-win_amd64.whl", hash = "sha256:0d32576b1de5a30d9a97f300cc6a3f4694c428d956adbc7e6e2f9cad279e45ed"}, + {file = "pydantic_core-2.16.3-cp312-none-win_arm64.whl", hash = "sha256:ec08be75bb268473677edb83ba71e7e74b43c008e4a7b1907c6d57e940bf34b6"}, + {file = "pydantic_core-2.16.3-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:b1f6f5938d63c6139860f044e2538baeee6f0b251a1816e7adb6cbce106a1f01"}, + {file = "pydantic_core-2.16.3-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:2a1ef6a36fdbf71538142ed604ad19b82f67b05749512e47f247a6ddd06afdc7"}, + {file = "pydantic_core-2.16.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:704d35ecc7e9c31d48926150afada60401c55efa3b46cd1ded5a01bdffaf1d48"}, + {file = "pydantic_core-2.16.3-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d937653a696465677ed583124b94a4b2d79f5e30b2c46115a68e482c6a591c8a"}, + {file = "pydantic_core-2.16.3-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c9803edf8e29bd825f43481f19c37f50d2b01899448273b3a7758441b512acf8"}, + {file = "pydantic_core-2.16.3-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:72282ad4892a9fb2da25defeac8c2e84352c108705c972db82ab121d15f14e6d"}, + {file = "pydantic_core-2.16.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7f752826b5b8361193df55afcdf8ca6a57d0232653494ba473630a83ba50d8c9"}, + {file = "pydantic_core-2.16.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:4384a8f68ddb31a0b0c3deae88765f5868a1b9148939c3f4121233314ad5532c"}, + {file = "pydantic_core-2.16.3-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:a4b2bf78342c40b3dc830880106f54328928ff03e357935ad26c7128bbd66ce8"}, + {file = "pydantic_core-2.16.3-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:13dcc4802961b5f843a9385fc821a0b0135e8c07fc3d9949fd49627c1a5e6ae5"}, + {file = "pydantic_core-2.16.3-cp38-none-win32.whl", hash = "sha256:e3e70c94a0c3841e6aa831edab1619ad5c511199be94d0c11ba75fe06efe107a"}, + {file = "pydantic_core-2.16.3-cp38-none-win_amd64.whl", hash = "sha256:ecdf6bf5f578615f2e985a5e1f6572e23aa632c4bd1dc67f8f406d445ac115ed"}, + {file = "pydantic_core-2.16.3-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:bda1ee3e08252b8d41fa5537413ffdddd58fa73107171a126d3b9ff001b9b820"}, + {file = "pydantic_core-2.16.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:21b888c973e4f26b7a96491c0965a8a312e13be108022ee510248fe379a5fa23"}, + {file = "pydantic_core-2.16.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:be0ec334369316fa73448cc8c982c01e5d2a81c95969d58b8f6e272884df0074"}, + {file = "pydantic_core-2.16.3-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:b5b6079cc452a7c53dd378c6f881ac528246b3ac9aae0f8eef98498a75657805"}, + {file = "pydantic_core-2.16.3-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7ee8d5f878dccb6d499ba4d30d757111847b6849ae07acdd1205fffa1fc1253c"}, + {file = "pydantic_core-2.16.3-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7233d65d9d651242a68801159763d09e9ec96e8a158dbf118dc090cd77a104c9"}, + {file = "pydantic_core-2.16.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c6119dc90483a5cb50a1306adb8d52c66e447da88ea44f323e0ae1a5fcb14256"}, + {file = "pydantic_core-2.16.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:578114bc803a4c1ff9946d977c221e4376620a46cf78da267d946397dc9514a8"}, + {file = "pydantic_core-2.16.3-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:d8f99b147ff3fcf6b3cc60cb0c39ea443884d5559a30b1481e92495f2310ff2b"}, + {file = "pydantic_core-2.16.3-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:4ac6b4ce1e7283d715c4b729d8f9dab9627586dafce81d9eaa009dd7f25dd972"}, + {file = "pydantic_core-2.16.3-cp39-none-win32.whl", hash = "sha256:e7774b570e61cb998490c5235740d475413a1f6de823169b4cf94e2fe9e9f6b2"}, + {file = "pydantic_core-2.16.3-cp39-none-win_amd64.whl", hash = "sha256:9091632a25b8b87b9a605ec0e61f241c456e9248bfdcf7abdf344fdb169c81cf"}, + {file = "pydantic_core-2.16.3-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:36fa178aacbc277bc6b62a2c3da95226520da4f4e9e206fdf076484363895d2c"}, + {file = "pydantic_core-2.16.3-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:dcca5d2bf65c6fb591fff92da03f94cd4f315972f97c21975398bd4bd046854a"}, + {file = "pydantic_core-2.16.3-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2a72fb9963cba4cd5793854fd12f4cfee731e86df140f59ff52a49b3552db241"}, + {file = "pydantic_core-2.16.3-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b60cc1a081f80a2105a59385b92d82278b15d80ebb3adb200542ae165cd7d183"}, + {file = "pydantic_core-2.16.3-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:cbcc558401de90a746d02ef330c528f2e668c83350f045833543cd57ecead1ad"}, + {file = "pydantic_core-2.16.3-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:fee427241c2d9fb7192b658190f9f5fd6dfe41e02f3c1489d2ec1e6a5ab1e04a"}, + {file = "pydantic_core-2.16.3-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:f4cb85f693044e0f71f394ff76c98ddc1bc0953e48c061725e540396d5c8a2e1"}, + {file = "pydantic_core-2.16.3-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:b29eeb887aa931c2fcef5aa515d9d176d25006794610c264ddc114c053bf96fe"}, + {file = "pydantic_core-2.16.3-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:a425479ee40ff021f8216c9d07a6a3b54b31c8267c6e17aa88b70d7ebd0e5e5b"}, + {file = "pydantic_core-2.16.3-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:5c5cbc703168d1b7a838668998308018a2718c2130595e8e190220238addc96f"}, + {file = "pydantic_core-2.16.3-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:99b6add4c0b39a513d323d3b93bc173dac663c27b99860dd5bf491b240d26137"}, + {file = "pydantic_core-2.16.3-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:75f76ee558751746d6a38f89d60b6228fa174e5172d143886af0f85aa306fd89"}, + {file = "pydantic_core-2.16.3-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:00ee1c97b5364b84cb0bd82e9bbf645d5e2871fb8c58059d158412fee2d33d8a"}, + {file = "pydantic_core-2.16.3-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:287073c66748f624be4cef893ef9174e3eb88fe0b8a78dc22e88eca4bc357ca6"}, + {file = "pydantic_core-2.16.3-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:ed25e1835c00a332cb10c683cd39da96a719ab1dfc08427d476bce41b92531fc"}, + {file = "pydantic_core-2.16.3-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:86b3d0033580bd6bbe07590152007275bd7af95f98eaa5bd36f3da219dcd93da"}, + {file = "pydantic_core-2.16.3.tar.gz", hash = "sha256:1cac689f80a3abab2d3c0048b29eea5751114054f032a941a32de4c852c59cad"}, ] [package.dependencies] @@ -406,7 +358,6 @@ files = [ [package.dependencies] colorama = {version = "*", markers = "sys_platform == \"win32\""} exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} -importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} iniconfig = "*" packaging = "*" pluggy = ">=0.12,<2.0" @@ -437,83 +388,18 @@ files = [ {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, ] -[[package]] -name = "typed-ast" -version = "1.5.5" -description = "a fork of Python 2 and 3 ast modules with type comment support" -optional = false -python-versions = ">=3.6" -files = [ - {file = "typed_ast-1.5.5-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:4bc1efe0ce3ffb74784e06460f01a223ac1f6ab31c6bc0376a21184bf5aabe3b"}, - {file = "typed_ast-1.5.5-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:5f7a8c46a8b333f71abd61d7ab9255440d4a588f34a21f126bbfc95f6049e686"}, - {file = "typed_ast-1.5.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:597fc66b4162f959ee6a96b978c0435bd63791e31e4f410622d19f1686d5e769"}, - {file = "typed_ast-1.5.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d41b7a686ce653e06c2609075d397ebd5b969d821b9797d029fccd71fdec8e04"}, - {file = "typed_ast-1.5.5-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:5fe83a9a44c4ce67c796a1b466c270c1272e176603d5e06f6afbc101a572859d"}, - {file = "typed_ast-1.5.5-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:d5c0c112a74c0e5db2c75882a0adf3133adedcdbfd8cf7c9d6ed77365ab90a1d"}, - {file = "typed_ast-1.5.5-cp310-cp310-win_amd64.whl", hash = "sha256:e1a976ed4cc2d71bb073e1b2a250892a6e968ff02aa14c1f40eba4f365ffec02"}, - {file = "typed_ast-1.5.5-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c631da9710271cb67b08bd3f3813b7af7f4c69c319b75475436fcab8c3d21bee"}, - {file = "typed_ast-1.5.5-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:b445c2abfecab89a932b20bd8261488d574591173d07827c1eda32c457358b18"}, - {file = "typed_ast-1.5.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cc95ffaaab2be3b25eb938779e43f513e0e538a84dd14a5d844b8f2932593d88"}, - {file = "typed_ast-1.5.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:61443214d9b4c660dcf4b5307f15c12cb30bdfe9588ce6158f4a005baeb167b2"}, - {file = "typed_ast-1.5.5-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:6eb936d107e4d474940469e8ec5b380c9b329b5f08b78282d46baeebd3692dc9"}, - {file = "typed_ast-1.5.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:e48bf27022897577d8479eaed64701ecaf0467182448bd95759883300ca818c8"}, - {file = "typed_ast-1.5.5-cp311-cp311-win_amd64.whl", hash = "sha256:83509f9324011c9a39faaef0922c6f720f9623afe3fe220b6d0b15638247206b"}, - {file = "typed_ast-1.5.5-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:44f214394fc1af23ca6d4e9e744804d890045d1643dd7e8229951e0ef39429b5"}, - {file = "typed_ast-1.5.5-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:118c1ce46ce58fda78503eae14b7664163aa735b620b64b5b725453696f2a35c"}, - {file = "typed_ast-1.5.5-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:be4919b808efa61101456e87f2d4c75b228f4e52618621c77f1ddcaae15904fa"}, - {file = "typed_ast-1.5.5-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:fc2b8c4e1bc5cd96c1a823a885e6b158f8451cf6f5530e1829390b4d27d0807f"}, - {file = "typed_ast-1.5.5-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:16f7313e0a08c7de57f2998c85e2a69a642e97cb32f87eb65fbfe88381a5e44d"}, - {file = "typed_ast-1.5.5-cp36-cp36m-win_amd64.whl", hash = "sha256:2b946ef8c04f77230489f75b4b5a4a6f24c078be4aed241cfabe9cbf4156e7e5"}, - {file = "typed_ast-1.5.5-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:2188bc33d85951ea4ddad55d2b35598b2709d122c11c75cffd529fbc9965508e"}, - {file = "typed_ast-1.5.5-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0635900d16ae133cab3b26c607586131269f88266954eb04ec31535c9a12ef1e"}, - {file = "typed_ast-1.5.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:57bfc3cf35a0f2fdf0a88a3044aafaec1d2f24d8ae8cd87c4f58d615fb5b6311"}, - {file = "typed_ast-1.5.5-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:fe58ef6a764de7b4b36edfc8592641f56e69b7163bba9f9c8089838ee596bfb2"}, - {file = "typed_ast-1.5.5-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:d09d930c2d1d621f717bb217bf1fe2584616febb5138d9b3e8cdd26506c3f6d4"}, - {file = "typed_ast-1.5.5-cp37-cp37m-win_amd64.whl", hash = "sha256:d40c10326893ecab8a80a53039164a224984339b2c32a6baf55ecbd5b1df6431"}, - {file = "typed_ast-1.5.5-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:fd946abf3c31fb50eee07451a6aedbfff912fcd13cf357363f5b4e834cc5e71a"}, - {file = "typed_ast-1.5.5-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:ed4a1a42df8a3dfb6b40c3d2de109e935949f2f66b19703eafade03173f8f437"}, - {file = "typed_ast-1.5.5-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:045f9930a1550d9352464e5149710d56a2aed23a2ffe78946478f7b5416f1ede"}, - {file = "typed_ast-1.5.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:381eed9c95484ceef5ced626355fdc0765ab51d8553fec08661dce654a935db4"}, - {file = "typed_ast-1.5.5-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:bfd39a41c0ef6f31684daff53befddae608f9daf6957140228a08e51f312d7e6"}, - {file = "typed_ast-1.5.5-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:8c524eb3024edcc04e288db9541fe1f438f82d281e591c548903d5b77ad1ddd4"}, - {file = "typed_ast-1.5.5-cp38-cp38-win_amd64.whl", hash = "sha256:7f58fabdde8dcbe764cef5e1a7fcb440f2463c1bbbec1cf2a86ca7bc1f95184b"}, - {file = "typed_ast-1.5.5-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:042eb665ff6bf020dd2243307d11ed626306b82812aba21836096d229fdc6a10"}, - {file = "typed_ast-1.5.5-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:622e4a006472b05cf6ef7f9f2636edc51bda670b7bbffa18d26b255269d3d814"}, - {file = "typed_ast-1.5.5-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1efebbbf4604ad1283e963e8915daa240cb4bf5067053cf2f0baadc4d4fb51b8"}, - {file = "typed_ast-1.5.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f0aefdd66f1784c58f65b502b6cf8b121544680456d1cebbd300c2c813899274"}, - {file = "typed_ast-1.5.5-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:48074261a842acf825af1968cd912f6f21357316080ebaca5f19abbb11690c8a"}, - {file = "typed_ast-1.5.5-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:429ae404f69dc94b9361bb62291885894b7c6fb4640d561179548c849f8492ba"}, - {file = "typed_ast-1.5.5-cp39-cp39-win_amd64.whl", hash = "sha256:335f22ccb244da2b5c296e6f96b06ee9bed46526db0de38d2f0e5a6597b81155"}, - {file = "typed_ast-1.5.5.tar.gz", hash = "sha256:94282f7a354f36ef5dbce0ef3467ebf6a258e370ab33d5b40c249fa996e590dd"}, -] - [[package]] name = "typing-extensions" -version = "4.7.1" -description = "Backported and Experimental Type Hints for Python 3.7+" +version = "4.10.0" +description = "Backported and Experimental Type Hints for Python 3.8+" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "typing_extensions-4.7.1-py3-none-any.whl", hash = "sha256:440d5dd3af93b060174bf433bccd69b0babc3b15b1a8dca43789fd7f61514b36"}, - {file = "typing_extensions-4.7.1.tar.gz", hash = "sha256:b75ddc264f0ba5615db7ba217daeb99701ad295353c45f9e95963337ceeeffb2"}, + {file = "typing_extensions-4.10.0-py3-none-any.whl", hash = "sha256:69b1a937c3a517342112fb4c6df7e72fc39a38e7891a5730ed4985b5214b5475"}, + {file = "typing_extensions-4.10.0.tar.gz", hash = "sha256:b0abd7c89e8fb96f98db18d86106ff1d90ab692004eb746cf6eda2682f91b3cb"}, ] -[[package]] -name = "zipp" -version = "3.15.0" -description = "Backport of pathlib-compatible object wrapper for zip files" -optional = false -python-versions = ">=3.7" -files = [ - {file = "zipp-3.15.0-py3-none-any.whl", hash = "sha256:48904fc76a60e542af151aded95726c1a5c34ed43ab4134b597665c86d7ad556"}, - {file = "zipp-3.15.0.tar.gz", hash = "sha256:112929ad649da941c23de50f356a2b5570c954b65150642bccdd66bf194d224b"}, -] - -[package.extras] -docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] -testing = ["big-O", "flake8 (<5)", "jaraco.functools", "jaraco.itertools", "more-itertools", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)"] - [metadata] lock-version = "2.0" -python-versions = "^3.7" -content-hash = "4ac84aae6b05a415337279868d39fe7ce44104dffcd6b159af9e12dcea350ba1" +python-versions = "^3.8" +content-hash = "3c8fae8de68e5484c48073bf191e51acbe3b9a32fd98e6b5e4d165e42a7fc7aa" diff --git a/pyproject.toml b/pyproject.toml index 0fe72e8..4e9a3ca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "superagent-py" -version = "v0.2.16" +version = "v0.2.17" description = "" readme = "README.md" authors = [] @@ -9,12 +9,13 @@ packages = [ ] [tool.poetry.dependencies] -python = "^3.7" +python = "^3.8" httpx = ">=0.21.2" -pydantic = ">= 1.9.2, < 2.5.0" +pydantic = ">= 1.9.2" +typing_extensions = ">= 4.0.0" [tool.poetry.dev-dependencies] -mypy = "0.971" +mypy = "^1.8.0" pytest = "^7.4.0" [build-system] diff --git a/src/superagent/client.py b/src/superagent/client.py index 4e919d9..55301af 100644 --- a/src/superagent/client.py +++ b/src/superagent/client.py @@ -18,6 +18,29 @@ class Superagent: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: typing.Optional[str]. The base url to use for requests from the client. + + - environment: SuperagentEnvironment. The environment to use for requests from the client. from .environment import SuperagentEnvironment + + Defaults to SuperagentEnvironment.DEFAULT + + - token: typing.Optional[typing.Union[str, typing.Callable[[], str]]]. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from superagent.client import Superagent + + client = Superagent( + token="YOUR_TOKEN", + ) + """ + def __init__( self, *, @@ -44,6 +67,29 @@ def __init__( class AsyncSuperagent: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: typing.Optional[str]. The base url to use for requests from the client. + + - environment: SuperagentEnvironment. The environment to use for requests from the client. from .environment import SuperagentEnvironment + + Defaults to SuperagentEnvironment.DEFAULT + + - token: typing.Optional[typing.Union[str, typing.Callable[[], str]]]. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from superagent.client import AsyncSuperagent + + client = AsyncSuperagent( + token="YOUR_TOKEN", + ) + """ + def __init__( self, *, diff --git a/src/superagent/core/__init__.py b/src/superagent/core/__init__.py index 2414955..b3e43c2 100644 --- a/src/superagent/core/__init__.py +++ b/src/superagent/core/__init__.py @@ -3,14 +3,22 @@ from .api_error import ApiError from .client_wrapper import AsyncClientWrapper, BaseClientWrapper, SyncClientWrapper from .datetime_utils import serialize_datetime +from .file import File, convert_file_dict_to_httpx_tuples +from .http_client import AsyncHttpClient, HttpClient from .jsonable_encoder import jsonable_encoder from .remove_none_from_dict import remove_none_from_dict +from .request_options import RequestOptions __all__ = [ "ApiError", "AsyncClientWrapper", + "AsyncHttpClient", "BaseClientWrapper", + "File", + "HttpClient", + "RequestOptions", "SyncClientWrapper", + "convert_file_dict_to_httpx_tuples", "jsonable_encoder", "remove_none_from_dict", "serialize_datetime", diff --git a/src/superagent/core/client_wrapper.py b/src/superagent/core/client_wrapper.py index aab3ef9..25e4101 100644 --- a/src/superagent/core/client_wrapper.py +++ b/src/superagent/core/client_wrapper.py @@ -4,6 +4,8 @@ import httpx +from .http_client import AsyncHttpClient, HttpClient + class BaseClientWrapper: def __init__(self, *, token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None, base_url: str): @@ -14,7 +16,7 @@ def get_headers(self) -> typing.Dict[str, str]: headers: typing.Dict[str, str] = { "X-Fern-Language": "Python", "X-Fern-SDK-Name": "superagent-py", - "X-Fern-SDK-Version": "v0.2.16", + "X-Fern-SDK-Version": "v0.2.17", } token = self._get_token() if token is not None: @@ -40,7 +42,7 @@ def __init__( httpx_client: httpx.Client, ): super().__init__(token=token, base_url=base_url) - self.httpx_client = httpx_client + self.httpx_client = HttpClient(httpx_client=httpx_client) class AsyncClientWrapper(BaseClientWrapper): @@ -52,4 +54,4 @@ def __init__( httpx_client: httpx.AsyncClient, ): super().__init__(token=token, base_url=base_url) - self.httpx_client = httpx_client + self.httpx_client = AsyncHttpClient(httpx_client=httpx_client) diff --git a/src/superagent/core/file.py b/src/superagent/core/file.py new file mode 100644 index 0000000..cb0d40b --- /dev/null +++ b/src/superagent/core/file.py @@ -0,0 +1,38 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +# File typing inspired by the flexibility of types within the httpx library +# https://github.com/encode/httpx/blob/master/httpx/_types.py +FileContent = typing.Union[typing.IO[bytes], bytes, str] +File = typing.Union[ + # file (or bytes) + FileContent, + # (filename, file (or bytes)) + typing.Tuple[typing.Optional[str], FileContent], + # (filename, file (or bytes), content_type) + typing.Tuple[typing.Optional[str], FileContent, typing.Optional[str]], + # (filename, file (or bytes), content_type, headers) + typing.Tuple[typing.Optional[str], FileContent, typing.Optional[str], typing.Mapping[str, str]], +] + + +def convert_file_dict_to_httpx_tuples( + d: typing.Dict[str, typing.Union[File, typing.List[File]]] +) -> typing.List[typing.Tuple[str, File]]: + """ + The format we use is a list of tuples, where the first element is the + name of the file and the second is the file object. Typically HTTPX wants + a dict, but to be able to send lists of files, you have to use the list + approach (which also works for non-lists) + https://github.com/encode/httpx/pull/1032 + """ + + httpx_tuples = [] + for key, file_like in d.items(): + if isinstance(file_like, list): + for file_like_item in file_like: + httpx_tuples.append((key, file_like_item)) + else: + httpx_tuples.append((key, file_like)) + return httpx_tuples diff --git a/src/superagent/core/http_client.py b/src/superagent/core/http_client.py new file mode 100644 index 0000000..fbbbc15 --- /dev/null +++ b/src/superagent/core/http_client.py @@ -0,0 +1,125 @@ +# This file was auto-generated by Fern from our API Definition. + +import asyncio +import email.utils +import re +import time +import typing +from functools import wraps +from random import random + +import httpx + +INITIAL_RETRY_DELAY_SECONDS = 0.5 +MAX_RETRY_DELAY_SECONDS = 10 +MAX_RETRY_DELAY_SECONDS_FROM_HEADER = 30 + + +def _parse_retry_after(response_headers: httpx.Headers) -> typing.Optional[float]: + """ + This function parses the `Retry-After` header in a HTTP response and returns the number of seconds to wait. + + Inspired by the urllib3 retry implementation. + """ + retry_after_ms = response_headers.get("retry-after-ms") + if retry_after_ms is not None: + try: + return int(retry_after_ms) / 1000 if retry_after_ms > 0 else 0 + except Exception: + pass + + retry_after = response_headers.get("retry-after") + if retry_after is None: + return None + + # Attempt to parse the header as an int. + if re.match(r"^\s*[0-9]+\s*$", retry_after): + seconds = float(retry_after) + # Fallback to parsing it as a date. + else: + retry_date_tuple = email.utils.parsedate_tz(retry_after) + if retry_date_tuple is None: + return None + if retry_date_tuple[9] is None: # Python 2 + # Assume UTC if no timezone was specified + # On Python2.7, parsedate_tz returns None for a timezone offset + # instead of 0 if no timezone is given, where mktime_tz treats + # a None timezone offset as local time. + retry_date_tuple = retry_date_tuple[:9] + (0,) + retry_date_tuple[10:] + + retry_date = email.utils.mktime_tz(retry_date_tuple) + seconds = retry_date - time.time() + + if seconds < 0: + seconds = 0 + + return seconds + + +def _retry_timeout(response: httpx.Response, retries: int) -> float: + """ + Determine the amount of time to wait before retrying a request. + This function begins by trying to parse a retry-after header from the response, and then proceeds to use exponential backoff + with a jitter to determine the number of seconds to wait. + """ + + # If the API asks us to wait a certain amount of time (and it's a reasonable amount), just do what it says. + retry_after = _parse_retry_after(response.headers) + if retry_after is not None and retry_after <= MAX_RETRY_DELAY_SECONDS_FROM_HEADER: + return retry_after + + # Apply exponential backoff, capped at MAX_RETRY_DELAY_SECONDS. + retry_delay = min(INITIAL_RETRY_DELAY_SECONDS * pow(2.0, retries), MAX_RETRY_DELAY_SECONDS) + + # Add a randomness / jitter to the retry delay to avoid overwhelming the server with retries. + timeout = retry_delay * (1 - 0.25 * random()) + return timeout if timeout >= 0 else 0 + + +def _should_retry(response: httpx.Response) -> bool: + retriable_400s = [429, 408, 409] + return response.status_code >= 500 or response.status_code in retriable_400s + + +class HttpClient: + def __init__(self, *, httpx_client: httpx.Client): + self.httpx_client = httpx_client + + # Ensure that the signature of the `request` method is the same as the `httpx.Client.request` method + @wraps(httpx.Client.request) + def request( + self, *args: typing.Any, max_retries: int = 0, retries: int = 0, **kwargs: typing.Any + ) -> httpx.Response: + response = self.httpx_client.request(*args, **kwargs) + if _should_retry(response=response): + if max_retries > retries: + time.sleep(_retry_timeout(response=response, retries=retries)) + return self.request(max_retries=max_retries, retries=retries + 1, *args, **kwargs) + return response + + @wraps(httpx.Client.stream) + def stream(self, *args: typing.Any, max_retries: int = 0, retries: int = 0, **kwargs: typing.Any) -> typing.Any: + return self.httpx_client.stream(*args, **kwargs) + + +class AsyncHttpClient: + def __init__(self, *, httpx_client: httpx.AsyncClient): + self.httpx_client = httpx_client + + # Ensure that the signature of the `request` method is the same as the `httpx.Client.request` method + @wraps(httpx.AsyncClient.request) + async def request( + self, *args: typing.Any, max_retries: int = 0, retries: int = 0, **kwargs: typing.Any + ) -> httpx.Response: + response = await self.httpx_client.request(*args, **kwargs) + if _should_retry(response=response): + if max_retries > retries: + await asyncio.sleep(_retry_timeout(response=response, retries=retries)) + return await self.request(max_retries=max_retries, retries=retries + 1, *args, **kwargs) + return response + + @wraps(httpx.AsyncClient.request) + async def stream( + self, *args: typing.Any, max_retries: int = 0, retries: int = 0, **kwargs: typing.Any + ) -> typing.Any: + return self.httpx_client.stream(*args, **kwargs) diff --git a/src/superagent/core/request_options.py b/src/superagent/core/request_options.py new file mode 100644 index 0000000..cd6f27a --- /dev/null +++ b/src/superagent/core/request_options.py @@ -0,0 +1,32 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +try: + from typing import NotRequired # type: ignore +except ImportError: + from typing_extensions import NotRequired # type: ignore + + +class RequestOptions(typing.TypedDict): + """ + Additional options for request-specific configuration when calling APIs via the SDK. + This is used primarily as an optional final parameter for service functions. + + Attributes: + - timeout_in_seconds: int. The number of seconds to await an API call before timing out. + + - max_retries: int. The max number of retries to attempt if the API call fails. + + - additional_headers: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's header dict + + - additional_query_parameters: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's query parameters dict + + - additional_body_parameters: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's body parameters dict + """ + + timeout_in_seconds: NotRequired[int] + max_retries: NotRequired[int] + additional_headers: NotRequired[typing.Dict[str, typing.Any]] + additional_query_parameters: NotRequired[typing.Dict[str, typing.Any]] + additional_body_parameters: NotRequired[typing.Dict[str, typing.Any]] diff --git a/src/superagent/resources/agent/client.py b/src/superagent/resources/agent/client.py index 8838ec6..77970e1 100644 --- a/src/superagent/resources/agent/client.py +++ b/src/superagent/resources/agent/client.py @@ -8,6 +8,7 @@ from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.jsonable_encoder import jsonable_encoder from ...core.remove_none_from_dict import remove_none_from_dict +from ...core.request_options import RequestOptions from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.agent_datasosurce_list import AgentDatasosurceList from ...types.agent_list import AgentList @@ -33,7 +34,13 @@ class AgentClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def list(self, *, skip: typing.Optional[int] = None, take: typing.Optional[int] = None) -> AgentList: + def list( + self, + *, + skip: typing.Optional[int] = None, + take: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AgentList: """ List all agents @@ -41,13 +48,38 @@ def list(self, *, skip: typing.Optional[int] = None, take: typing.Optional[int] - skip: typing.Optional[int]. - take: typing.Optional[int]. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = self._client_wrapper.httpx_client.request( "GET", urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/agents"), - params=remove_none_from_dict({"skip": skip, "take": take}), - headers=self._client_wrapper.get_headers(), - timeout=60, + params=jsonable_encoder( + remove_none_from_dict( + { + "skip": skip, + "take": take, + **( + request_options.get("additional_query_parameters", {}) + if request_options is not None + else {} + ), + } + ) + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AgentList, _response.json()) # type: ignore @@ -73,6 +105,7 @@ def create( type: typing.Optional[AgentType] = OMIT, parameters: typing.Optional[OpenAiAssistantParameters] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> AppModelsResponseAgent: """ Create a new agent @@ -99,6 +132,8 @@ def create( - parameters: typing.Optional[OpenAiAssistantParameters]. - metadata: typing.Optional[typing.Dict[str, typing.Any]]. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _request: typing.Dict[str, typing.Any] = {"name": name} if is_active is not OMIT: @@ -110,13 +145,13 @@ def create( if llm_model is not OMIT: _request["llmModel"] = llm_model if llm_provider is not OMIT: - _request["llmProvider"] = llm_provider.value + _request["llmProvider"] = llm_provider if description is not OMIT: _request["description"] = description if avatar is not OMIT: _request["avatar"] = avatar if type is not OMIT: - _request["type"] = type.value + _request["type"] = type if parameters is not OMIT: _request["parameters"] = parameters if metadata is not OMIT: @@ -124,9 +159,28 @@ def create( _response = self._client_wrapper.httpx_client.request( "POST", urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/agents"), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=60, + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(_request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(_request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseAgent, _response.json()) # type: ignore @@ -138,18 +192,36 @@ def create( raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def get(self, agent_id: str) -> AppModelsResponseAgent: + def get(self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> AppModelsResponseAgent: """ Get a single agent Parameters: - agent_id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = self._client_wrapper.httpx_client.request( "GET", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/agents/{agent_id}"), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/agents/{jsonable_encoder(agent_id)}" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseAgent, _response.json()) # type: ignore @@ -161,18 +233,36 @@ def get(self, agent_id: str) -> AppModelsResponseAgent: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def delete(self, agent_id: str) -> typing.Any: + def delete(self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any: """ Delete an agent Parameters: - agent_id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = self._client_wrapper.httpx_client.request( "DELETE", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/agents/{agent_id}"), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/agents/{jsonable_encoder(agent_id)}" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore @@ -197,6 +287,7 @@ def update( avatar: typing.Optional[str] = OMIT, type: typing.Optional[str] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> AppModelsResponseAgent: """ Patch an agent @@ -221,6 +312,8 @@ def update( - type: typing.Optional[str]. - metadata: typing.Optional[typing.Dict[str, typing.Any]]. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _request: typing.Dict[str, typing.Any] = {} if is_active is not OMIT: @@ -243,10 +336,31 @@ def update( _request["metadata"] = metadata _response = self._client_wrapper.httpx_client.request( "PATCH", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/agents/{agent_id}"), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/agents/{jsonable_encoder(agent_id)}" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(_request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(_request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseAgent, _response.json()) # type: ignore @@ -267,6 +381,7 @@ def invoke( enable_streaming: bool, output_schema: typing.Optional[str] = OMIT, llm_params: typing.Optional[LlmParams] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> AppModelsResponseAgentInvoke: """ Invoke an agent @@ -283,6 +398,8 @@ def invoke( - output_schema: typing.Optional[str]. - llm_params: typing.Optional[LlmParams]. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _request: typing.Dict[str, typing.Any] = {"input": input, "enableStreaming": enable_streaming} if session_id is not OMIT: @@ -293,10 +410,31 @@ def invoke( _request["llm_params"] = llm_params _response = self._client_wrapper.httpx_client.request( "POST", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/agents/{agent_id}/invoke"), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/agents/{jsonable_encoder(agent_id)}/invoke" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(_request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(_request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseAgentInvoke, _response.json()) # type: ignore @@ -308,7 +446,9 @@ def invoke( raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def add_llm(self, agent_id: str, *, llm_id: str) -> AppModelsResponseAgent: + def add_llm( + self, agent_id: str, *, llm_id: str, request_options: typing.Optional[RequestOptions] = None + ) -> AppModelsResponseAgent: """ Add LLM to agent @@ -316,13 +456,36 @@ def add_llm(self, agent_id: str, *, llm_id: str) -> AppModelsResponseAgent: - agent_id: str. - llm_id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = self._client_wrapper.httpx_client.request( "POST", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/agents/{agent_id}/llms"), - json=jsonable_encoder({"llmId": llm_id}), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/agents/{jsonable_encoder(agent_id)}/llms" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder({"llmId": llm_id}) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder({"llmId": llm_id}), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseAgent, _response.json()) # type: ignore @@ -334,7 +497,9 @@ def add_llm(self, agent_id: str, *, llm_id: str) -> AppModelsResponseAgent: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def remove_llm(self, agent_id: str, llm_id: str) -> typing.Any: + def remove_llm( + self, agent_id: str, llm_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> typing.Any: """ Remove LLM from agent @@ -342,12 +507,31 @@ def remove_llm(self, agent_id: str, llm_id: str) -> typing.Any: - agent_id: str. - llm_id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = self._client_wrapper.httpx_client.request( "DELETE", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/agents/{agent_id}/llms/{llm_id}"), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", + f"api/v1/agents/{jsonable_encoder(agent_id)}/llms/{jsonable_encoder(llm_id)}", + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore @@ -359,18 +543,36 @@ def remove_llm(self, agent_id: str, llm_id: str) -> typing.Any: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def list_tools(self, agent_id: str) -> AgentToolList: + def list_tools(self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> AgentToolList: """ List agent tools Parameters: - agent_id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = self._client_wrapper.httpx_client.request( "GET", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/agents/{agent_id}/tools"), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/agents/{jsonable_encoder(agent_id)}/tools" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AgentToolList, _response.json()) # type: ignore @@ -382,7 +584,9 @@ def list_tools(self, agent_id: str) -> AgentToolList: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def add_tool(self, agent_id: str, *, tool_id: str) -> AppModelsResponseAgent: + def add_tool( + self, agent_id: str, *, tool_id: str, request_options: typing.Optional[RequestOptions] = None + ) -> AppModelsResponseAgent: """ Add tool to agent @@ -390,13 +594,36 @@ def add_tool(self, agent_id: str, *, tool_id: str) -> AppModelsResponseAgent: - agent_id: str. - tool_id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = self._client_wrapper.httpx_client.request( "POST", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/agents/{agent_id}/tools"), - json=jsonable_encoder({"toolId": tool_id}), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/agents/{jsonable_encoder(agent_id)}/tools" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder({"toolId": tool_id}) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder({"toolId": tool_id}), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseAgent, _response.json()) # type: ignore @@ -408,7 +635,9 @@ def add_tool(self, agent_id: str, *, tool_id: str) -> AppModelsResponseAgent: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def remove_tool(self, agent_id: str, tool_id: str) -> typing.Any: + def remove_tool( + self, agent_id: str, tool_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> typing.Any: """ Remove tool from agent @@ -416,14 +645,31 @@ def remove_tool(self, agent_id: str, tool_id: str) -> typing.Any: - agent_id: str. - tool_id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = self._client_wrapper.httpx_client.request( "DELETE", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"api/v1/agents/{agent_id}/tools/{tool_id}" + f"{self._client_wrapper.get_base_url()}/", + f"api/v1/agents/{jsonable_encoder(agent_id)}/tools/{jsonable_encoder(tool_id)}", ), - headers=self._client_wrapper.get_headers(), - timeout=60, + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore @@ -435,18 +681,38 @@ def remove_tool(self, agent_id: str, tool_id: str) -> typing.Any: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def list_datasources(self, agent_id: str) -> AgentDatasosurceList: + def list_datasources( + self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AgentDatasosurceList: """ List agent datasources Parameters: - agent_id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = self._client_wrapper.httpx_client.request( "GET", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/agents/{agent_id}/datasources"), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/agents/{jsonable_encoder(agent_id)}/datasources" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AgentDatasosurceList, _response.json()) # type: ignore @@ -458,7 +724,9 @@ def list_datasources(self, agent_id: str) -> AgentDatasosurceList: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def add_datasource(self, agent_id: str, *, datasource_id: str) -> AppModelsResponseAgent: + def add_datasource( + self, agent_id: str, *, datasource_id: str, request_options: typing.Optional[RequestOptions] = None + ) -> AppModelsResponseAgent: """ Add datasource to agent @@ -466,13 +734,36 @@ def add_datasource(self, agent_id: str, *, datasource_id: str) -> AppModelsRespo - agent_id: str. - datasource_id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = self._client_wrapper.httpx_client.request( "POST", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/agents/{agent_id}/datasources"), - json=jsonable_encoder({"datasourceId": datasource_id}), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/agents/{jsonable_encoder(agent_id)}/datasources" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder({"datasourceId": datasource_id}) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder({"datasourceId": datasource_id}), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseAgent, _response.json()) # type: ignore @@ -484,7 +775,9 @@ def add_datasource(self, agent_id: str, *, datasource_id: str) -> AppModelsRespo raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def remove_datasource(self, agent_id: str, datasource_id: str) -> typing.Any: + def remove_datasource( + self, agent_id: str, datasource_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> typing.Any: """ Remove datasource from agent @@ -492,14 +785,31 @@ def remove_datasource(self, agent_id: str, datasource_id: str) -> typing.Any: - agent_id: str. - datasource_id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = self._client_wrapper.httpx_client.request( "DELETE", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"api/v1/agents/{agent_id}/datasources/{datasource_id}" + f"{self._client_wrapper.get_base_url()}/", + f"api/v1/agents/{jsonable_encoder(agent_id)}/datasources/{jsonable_encoder(datasource_id)}", + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None ), - headers=self._client_wrapper.get_headers(), - timeout=60, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore @@ -516,7 +826,13 @@ class AsyncAgentClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - async def list(self, *, skip: typing.Optional[int] = None, take: typing.Optional[int] = None) -> AgentList: + async def list( + self, + *, + skip: typing.Optional[int] = None, + take: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AgentList: """ List all agents @@ -524,13 +840,38 @@ async def list(self, *, skip: typing.Optional[int] = None, take: typing.Optional - skip: typing.Optional[int]. - take: typing.Optional[int]. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = await self._client_wrapper.httpx_client.request( "GET", urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/agents"), - params=remove_none_from_dict({"skip": skip, "take": take}), - headers=self._client_wrapper.get_headers(), - timeout=60, + params=jsonable_encoder( + remove_none_from_dict( + { + "skip": skip, + "take": take, + **( + request_options.get("additional_query_parameters", {}) + if request_options is not None + else {} + ), + } + ) + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AgentList, _response.json()) # type: ignore @@ -556,6 +897,7 @@ async def create( type: typing.Optional[AgentType] = OMIT, parameters: typing.Optional[OpenAiAssistantParameters] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> AppModelsResponseAgent: """ Create a new agent @@ -582,6 +924,8 @@ async def create( - parameters: typing.Optional[OpenAiAssistantParameters]. - metadata: typing.Optional[typing.Dict[str, typing.Any]]. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _request: typing.Dict[str, typing.Any] = {"name": name} if is_active is not OMIT: @@ -593,13 +937,13 @@ async def create( if llm_model is not OMIT: _request["llmModel"] = llm_model if llm_provider is not OMIT: - _request["llmProvider"] = llm_provider.value + _request["llmProvider"] = llm_provider if description is not OMIT: _request["description"] = description if avatar is not OMIT: _request["avatar"] = avatar if type is not OMIT: - _request["type"] = type.value + _request["type"] = type if parameters is not OMIT: _request["parameters"] = parameters if metadata is not OMIT: @@ -607,9 +951,28 @@ async def create( _response = await self._client_wrapper.httpx_client.request( "POST", urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/agents"), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=60, + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(_request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(_request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseAgent, _response.json()) # type: ignore @@ -621,18 +984,38 @@ async def create( raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def get(self, agent_id: str) -> AppModelsResponseAgent: + async def get( + self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AppModelsResponseAgent: """ Get a single agent Parameters: - agent_id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = await self._client_wrapper.httpx_client.request( "GET", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/agents/{agent_id}"), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/agents/{jsonable_encoder(agent_id)}" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseAgent, _response.json()) # type: ignore @@ -644,18 +1027,36 @@ async def get(self, agent_id: str) -> AppModelsResponseAgent: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def delete(self, agent_id: str) -> typing.Any: + async def delete(self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any: """ Delete an agent Parameters: - agent_id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = await self._client_wrapper.httpx_client.request( "DELETE", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/agents/{agent_id}"), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/agents/{jsonable_encoder(agent_id)}" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore @@ -680,6 +1081,7 @@ async def update( avatar: typing.Optional[str] = OMIT, type: typing.Optional[str] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> AppModelsResponseAgent: """ Patch an agent @@ -704,6 +1106,8 @@ async def update( - type: typing.Optional[str]. - metadata: typing.Optional[typing.Dict[str, typing.Any]]. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _request: typing.Dict[str, typing.Any] = {} if is_active is not OMIT: @@ -726,10 +1130,31 @@ async def update( _request["metadata"] = metadata _response = await self._client_wrapper.httpx_client.request( "PATCH", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/agents/{agent_id}"), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/agents/{jsonable_encoder(agent_id)}" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(_request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(_request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseAgent, _response.json()) # type: ignore @@ -750,6 +1175,7 @@ async def invoke( enable_streaming: bool, output_schema: typing.Optional[str] = OMIT, llm_params: typing.Optional[LlmParams] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> AppModelsResponseAgentInvoke: """ Invoke an agent @@ -766,6 +1192,8 @@ async def invoke( - output_schema: typing.Optional[str]. - llm_params: typing.Optional[LlmParams]. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _request: typing.Dict[str, typing.Any] = {"input": input, "enableStreaming": enable_streaming} if session_id is not OMIT: @@ -776,10 +1204,31 @@ async def invoke( _request["llm_params"] = llm_params _response = await self._client_wrapper.httpx_client.request( "POST", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/agents/{agent_id}/invoke"), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/agents/{jsonable_encoder(agent_id)}/invoke" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(_request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(_request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseAgentInvoke, _response.json()) # type: ignore @@ -791,7 +1240,9 @@ async def invoke( raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def add_llm(self, agent_id: str, *, llm_id: str) -> AppModelsResponseAgent: + async def add_llm( + self, agent_id: str, *, llm_id: str, request_options: typing.Optional[RequestOptions] = None + ) -> AppModelsResponseAgent: """ Add LLM to agent @@ -799,13 +1250,36 @@ async def add_llm(self, agent_id: str, *, llm_id: str) -> AppModelsResponseAgent - agent_id: str. - llm_id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = await self._client_wrapper.httpx_client.request( "POST", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/agents/{agent_id}/llms"), - json=jsonable_encoder({"llmId": llm_id}), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/agents/{jsonable_encoder(agent_id)}/llms" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder({"llmId": llm_id}) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder({"llmId": llm_id}), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseAgent, _response.json()) # type: ignore @@ -817,7 +1291,9 @@ async def add_llm(self, agent_id: str, *, llm_id: str) -> AppModelsResponseAgent raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def remove_llm(self, agent_id: str, llm_id: str) -> typing.Any: + async def remove_llm( + self, agent_id: str, llm_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> typing.Any: """ Remove LLM from agent @@ -825,12 +1301,31 @@ async def remove_llm(self, agent_id: str, llm_id: str) -> typing.Any: - agent_id: str. - llm_id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = await self._client_wrapper.httpx_client.request( "DELETE", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/agents/{agent_id}/llms/{llm_id}"), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", + f"api/v1/agents/{jsonable_encoder(agent_id)}/llms/{jsonable_encoder(llm_id)}", + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore @@ -842,18 +1337,38 @@ async def remove_llm(self, agent_id: str, llm_id: str) -> typing.Any: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def list_tools(self, agent_id: str) -> AgentToolList: + async def list_tools( + self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AgentToolList: """ List agent tools Parameters: - agent_id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = await self._client_wrapper.httpx_client.request( "GET", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/agents/{agent_id}/tools"), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/agents/{jsonable_encoder(agent_id)}/tools" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AgentToolList, _response.json()) # type: ignore @@ -865,7 +1380,9 @@ async def list_tools(self, agent_id: str) -> AgentToolList: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def add_tool(self, agent_id: str, *, tool_id: str) -> AppModelsResponseAgent: + async def add_tool( + self, agent_id: str, *, tool_id: str, request_options: typing.Optional[RequestOptions] = None + ) -> AppModelsResponseAgent: """ Add tool to agent @@ -873,13 +1390,36 @@ async def add_tool(self, agent_id: str, *, tool_id: str) -> AppModelsResponseAge - agent_id: str. - tool_id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = await self._client_wrapper.httpx_client.request( "POST", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/agents/{agent_id}/tools"), - json=jsonable_encoder({"toolId": tool_id}), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/agents/{jsonable_encoder(agent_id)}/tools" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder({"toolId": tool_id}) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder({"toolId": tool_id}), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseAgent, _response.json()) # type: ignore @@ -891,7 +1431,9 @@ async def add_tool(self, agent_id: str, *, tool_id: str) -> AppModelsResponseAge raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def remove_tool(self, agent_id: str, tool_id: str) -> typing.Any: + async def remove_tool( + self, agent_id: str, tool_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> typing.Any: """ Remove tool from agent @@ -899,14 +1441,31 @@ async def remove_tool(self, agent_id: str, tool_id: str) -> typing.Any: - agent_id: str. - tool_id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = await self._client_wrapper.httpx_client.request( "DELETE", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"api/v1/agents/{agent_id}/tools/{tool_id}" + f"{self._client_wrapper.get_base_url()}/", + f"api/v1/agents/{jsonable_encoder(agent_id)}/tools/{jsonable_encoder(tool_id)}", + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) ), - headers=self._client_wrapper.get_headers(), - timeout=60, + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore @@ -918,18 +1477,38 @@ async def remove_tool(self, agent_id: str, tool_id: str) -> typing.Any: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def list_datasources(self, agent_id: str) -> AgentDatasosurceList: + async def list_datasources( + self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AgentDatasosurceList: """ List agent datasources Parameters: - agent_id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = await self._client_wrapper.httpx_client.request( "GET", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/agents/{agent_id}/datasources"), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/agents/{jsonable_encoder(agent_id)}/datasources" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AgentDatasosurceList, _response.json()) # type: ignore @@ -941,7 +1520,9 @@ async def list_datasources(self, agent_id: str) -> AgentDatasosurceList: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def add_datasource(self, agent_id: str, *, datasource_id: str) -> AppModelsResponseAgent: + async def add_datasource( + self, agent_id: str, *, datasource_id: str, request_options: typing.Optional[RequestOptions] = None + ) -> AppModelsResponseAgent: """ Add datasource to agent @@ -949,13 +1530,36 @@ async def add_datasource(self, agent_id: str, *, datasource_id: str) -> AppModel - agent_id: str. - datasource_id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = await self._client_wrapper.httpx_client.request( "POST", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/agents/{agent_id}/datasources"), - json=jsonable_encoder({"datasourceId": datasource_id}), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/agents/{jsonable_encoder(agent_id)}/datasources" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder({"datasourceId": datasource_id}) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder({"datasourceId": datasource_id}), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseAgent, _response.json()) # type: ignore @@ -967,7 +1571,9 @@ async def add_datasource(self, agent_id: str, *, datasource_id: str) -> AppModel raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def remove_datasource(self, agent_id: str, datasource_id: str) -> typing.Any: + async def remove_datasource( + self, agent_id: str, datasource_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> typing.Any: """ Remove datasource from agent @@ -975,14 +1581,31 @@ async def remove_datasource(self, agent_id: str, datasource_id: str) -> typing.A - agent_id: str. - datasource_id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = await self._client_wrapper.httpx_client.request( "DELETE", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"api/v1/agents/{agent_id}/datasources/{datasource_id}" + f"{self._client_wrapper.get_base_url()}/", + f"api/v1/agents/{jsonable_encoder(agent_id)}/datasources/{jsonable_encoder(datasource_id)}", + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) ), - headers=self._client_wrapper.get_headers(), - timeout=60, + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore diff --git a/src/superagent/resources/api_key/client.py b/src/superagent/resources/api_key/client.py index 02b82ff..75410e7 100644 --- a/src/superagent/resources/api_key/client.py +++ b/src/superagent/resources/api_key/client.py @@ -7,6 +7,8 @@ from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.jsonable_encoder import jsonable_encoder +from ...core.remove_none_from_dict import remove_none_from_dict +from ...core.request_options import RequestOptions from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.api_key_create import ApiKeyCreate from ...types.api_key_list import ApiKeyList @@ -27,15 +29,32 @@ class ApiKeyClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def list(self) -> ApiKeyList: + def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> ApiKeyList: """ List API keys + + Parameters: + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = self._client_wrapper.httpx_client.request( "GET", urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/api-keys"), - headers=self._client_wrapper.get_headers(), - timeout=60, + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(ApiKeyList, _response.json()) # type: ignore @@ -45,19 +64,42 @@ def list(self) -> ApiKeyList: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def create(self, *, request: AppModelsRequestApiKey) -> ApiKeyCreate: + def create( + self, *, request: AppModelsRequestApiKey, request_options: typing.Optional[RequestOptions] = None + ) -> ApiKeyCreate: """ Create a new API key Parameters: - request: AppModelsRequestApiKey. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = self._client_wrapper.httpx_client.request( "POST", urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/api-keys"), - json=jsonable_encoder(request), - headers=self._client_wrapper.get_headers(), - timeout=60, + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(ApiKeyCreate, _response.json()) # type: ignore @@ -69,18 +111,34 @@ def create(self, *, request: AppModelsRequestApiKey) -> ApiKeyCreate: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def delete(self, id: str) -> AppModelsResponseApiKey: + def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> AppModelsResponseApiKey: """ Delete an API key Parameters: - id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = self._client_wrapper.httpx_client.request( "DELETE", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/api-keys/{id}"), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/api-keys/{jsonable_encoder(id)}"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseApiKey, _response.json()) # type: ignore @@ -92,7 +150,9 @@ def delete(self, id: str) -> AppModelsResponseApiKey: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def update(self, id: str, *, request: AppModelsRequestApiKey) -> AppModelsResponseApiKey: + def update( + self, id: str, *, request: AppModelsRequestApiKey, request_options: typing.Optional[RequestOptions] = None + ) -> AppModelsResponseApiKey: """ Update an API key @@ -100,13 +160,34 @@ def update(self, id: str, *, request: AppModelsRequestApiKey) -> AppModelsRespon - id: str. - request: AppModelsRequestApiKey. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = self._client_wrapper.httpx_client.request( "PATCH", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/api-keys/{id}"), - json=jsonable_encoder(request), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/api-keys/{jsonable_encoder(id)}"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseApiKey, _response.json()) # type: ignore @@ -123,15 +204,32 @@ class AsyncApiKeyClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - async def list(self) -> ApiKeyList: + async def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> ApiKeyList: """ List API keys + + Parameters: + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = await self._client_wrapper.httpx_client.request( "GET", urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/api-keys"), - headers=self._client_wrapper.get_headers(), - timeout=60, + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(ApiKeyList, _response.json()) # type: ignore @@ -141,19 +239,42 @@ async def list(self) -> ApiKeyList: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def create(self, *, request: AppModelsRequestApiKey) -> ApiKeyCreate: + async def create( + self, *, request: AppModelsRequestApiKey, request_options: typing.Optional[RequestOptions] = None + ) -> ApiKeyCreate: """ Create a new API key Parameters: - request: AppModelsRequestApiKey. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = await self._client_wrapper.httpx_client.request( "POST", urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/api-keys"), - json=jsonable_encoder(request), - headers=self._client_wrapper.get_headers(), - timeout=60, + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(ApiKeyCreate, _response.json()) # type: ignore @@ -165,18 +286,36 @@ async def create(self, *, request: AppModelsRequestApiKey) -> ApiKeyCreate: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def delete(self, id: str) -> AppModelsResponseApiKey: + async def delete( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AppModelsResponseApiKey: """ Delete an API key Parameters: - id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = await self._client_wrapper.httpx_client.request( "DELETE", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/api-keys/{id}"), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/api-keys/{jsonable_encoder(id)}"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseApiKey, _response.json()) # type: ignore @@ -188,7 +327,9 @@ async def delete(self, id: str) -> AppModelsResponseApiKey: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def update(self, id: str, *, request: AppModelsRequestApiKey) -> AppModelsResponseApiKey: + async def update( + self, id: str, *, request: AppModelsRequestApiKey, request_options: typing.Optional[RequestOptions] = None + ) -> AppModelsResponseApiKey: """ Update an API key @@ -196,13 +337,34 @@ async def update(self, id: str, *, request: AppModelsRequestApiKey) -> AppModels - id: str. - request: AppModelsRequestApiKey. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = await self._client_wrapper.httpx_client.request( "PATCH", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/api-keys/{id}"), - json=jsonable_encoder(request), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/api-keys/{jsonable_encoder(id)}"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseApiKey, _response.json()) # type: ignore diff --git a/src/superagent/resources/api_user/client.py b/src/superagent/resources/api_user/client.py index e679e7c..1ececaa 100644 --- a/src/superagent/resources/api_user/client.py +++ b/src/superagent/resources/api_user/client.py @@ -7,6 +7,8 @@ from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.jsonable_encoder import jsonable_encoder +from ...core.remove_none_from_dict import remove_none_from_dict +from ...core.request_options import RequestOptions from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.app_models_request_api_user import AppModelsRequestApiUser from ...types.app_models_response_api_user import AppModelsResponseApiUser @@ -25,19 +27,42 @@ class ApiUserClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def create(self, *, request: AppModelsRequestApiUser) -> AppModelsResponseApiUser: + def create( + self, *, request: AppModelsRequestApiUser, request_options: typing.Optional[RequestOptions] = None + ) -> AppModelsResponseApiUser: """ Create a new API user Parameters: - request: AppModelsRequestApiUser. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = self._client_wrapper.httpx_client.request( "POST", urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/api-users"), - json=jsonable_encoder(request), - headers=self._client_wrapper.get_headers(), - timeout=60, + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseApiUser, _response.json()) # type: ignore @@ -49,15 +74,32 @@ def create(self, *, request: AppModelsRequestApiUser) -> AppModelsResponseApiUse raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def get(self) -> AppModelsResponseApiUser: + def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> AppModelsResponseApiUser: """ Get a single api user + + Parameters: + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = self._client_wrapper.httpx_client.request( "GET", urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/api-users/me"), - headers=self._client_wrapper.get_headers(), - timeout=60, + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseApiUser, _response.json()) # type: ignore @@ -67,15 +109,32 @@ def get(self) -> AppModelsResponseApiUser: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def delete(self) -> typing.Any: + def delete(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any: """ Delete an api user + + Parameters: + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = self._client_wrapper.httpx_client.request( "DELETE", urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/api-users/me"), - headers=self._client_wrapper.get_headers(), - timeout=60, + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore @@ -85,19 +144,42 @@ def delete(self) -> typing.Any: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def indentify(self, *, request: AppModelsRequestApiUser) -> typing.Any: + def indentify( + self, *, request: AppModelsRequestApiUser, request_options: typing.Optional[RequestOptions] = None + ) -> typing.Any: """ Indentify an api user Parameters: - request: AppModelsRequestApiUser. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = self._client_wrapper.httpx_client.request( "POST", urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/api-users/identify"), - json=jsonable_encoder(request), - headers=self._client_wrapper.get_headers(), - timeout=60, + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore @@ -114,19 +196,42 @@ class AsyncApiUserClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - async def create(self, *, request: AppModelsRequestApiUser) -> AppModelsResponseApiUser: + async def create( + self, *, request: AppModelsRequestApiUser, request_options: typing.Optional[RequestOptions] = None + ) -> AppModelsResponseApiUser: """ Create a new API user Parameters: - request: AppModelsRequestApiUser. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = await self._client_wrapper.httpx_client.request( "POST", urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/api-users"), - json=jsonable_encoder(request), - headers=self._client_wrapper.get_headers(), - timeout=60, + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseApiUser, _response.json()) # type: ignore @@ -138,15 +243,32 @@ async def create(self, *, request: AppModelsRequestApiUser) -> AppModelsResponse raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def get(self) -> AppModelsResponseApiUser: + async def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> AppModelsResponseApiUser: """ Get a single api user + + Parameters: + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = await self._client_wrapper.httpx_client.request( "GET", urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/api-users/me"), - headers=self._client_wrapper.get_headers(), - timeout=60, + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseApiUser, _response.json()) # type: ignore @@ -156,15 +278,32 @@ async def get(self) -> AppModelsResponseApiUser: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def delete(self) -> typing.Any: + async def delete(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any: """ Delete an api user + + Parameters: + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = await self._client_wrapper.httpx_client.request( "DELETE", urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/api-users/me"), - headers=self._client_wrapper.get_headers(), - timeout=60, + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore @@ -174,19 +313,42 @@ async def delete(self) -> typing.Any: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def indentify(self, *, request: AppModelsRequestApiUser) -> typing.Any: + async def indentify( + self, *, request: AppModelsRequestApiUser, request_options: typing.Optional[RequestOptions] = None + ) -> typing.Any: """ Indentify an api user Parameters: - request: AppModelsRequestApiUser. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = await self._client_wrapper.httpx_client.request( "POST", urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/api-users/identify"), - json=jsonable_encoder(request), - headers=self._client_wrapper.get_headers(), - timeout=60, + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore diff --git a/src/superagent/resources/datasource/client.py b/src/superagent/resources/datasource/client.py index 0d2a616..f13a498 100644 --- a/src/superagent/resources/datasource/client.py +++ b/src/superagent/resources/datasource/client.py @@ -8,6 +8,7 @@ from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.jsonable_encoder import jsonable_encoder from ...core.remove_none_from_dict import remove_none_from_dict +from ...core.request_options import RequestOptions from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.app_models_request_datasource import AppModelsRequestDatasource from ...types.app_models_response_datasource import AppModelsResponseDatasource @@ -27,7 +28,13 @@ class DatasourceClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def list(self, *, skip: typing.Optional[int] = None, take: typing.Optional[int] = None) -> DatasourceList: + def list( + self, + *, + skip: typing.Optional[int] = None, + take: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> DatasourceList: """ List all datasources @@ -35,13 +42,38 @@ def list(self, *, skip: typing.Optional[int] = None, take: typing.Optional[int] - skip: typing.Optional[int]. - take: typing.Optional[int]. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = self._client_wrapper.httpx_client.request( "GET", urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/datasources"), - params=remove_none_from_dict({"skip": skip, "take": take}), - headers=self._client_wrapper.get_headers(), - timeout=60, + params=jsonable_encoder( + remove_none_from_dict( + { + "skip": skip, + "take": take, + **( + request_options.get("additional_query_parameters", {}) + if request_options is not None + else {} + ), + } + ) + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(DatasourceList, _response.json()) # type: ignore @@ -53,19 +85,42 @@ def list(self, *, skip: typing.Optional[int] = None, take: typing.Optional[int] raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def create(self, *, request: AppModelsRequestDatasource) -> AppModelsResponseDatasource: + def create( + self, *, request: AppModelsRequestDatasource, request_options: typing.Optional[RequestOptions] = None + ) -> AppModelsResponseDatasource: """ Create a new datasource Parameters: - request: AppModelsRequestDatasource. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = self._client_wrapper.httpx_client.request( "POST", urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/datasources"), - json=jsonable_encoder(request), - headers=self._client_wrapper.get_headers(), - timeout=60, + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseDatasource, _response.json()) # type: ignore @@ -77,18 +132,38 @@ def create(self, *, request: AppModelsRequestDatasource) -> AppModelsResponseDat raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def get(self, datasource_id: str) -> AppModelsResponseDatasource: + def get( + self, datasource_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AppModelsResponseDatasource: """ Get a specific datasource Parameters: - datasource_id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = self._client_wrapper.httpx_client.request( "GET", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/datasources/{datasource_id}"), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/datasources/{jsonable_encoder(datasource_id)}" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseDatasource, _response.json()) # type: ignore @@ -100,18 +175,36 @@ def get(self, datasource_id: str) -> AppModelsResponseDatasource: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def delete(self, datasource_id: str) -> typing.Any: + def delete(self, datasource_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any: """ Delete a specific datasource Parameters: - datasource_id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = self._client_wrapper.httpx_client.request( "DELETE", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/datasources/{datasource_id}"), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/datasources/{jsonable_encoder(datasource_id)}" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore @@ -123,7 +216,13 @@ def delete(self, datasource_id: str) -> typing.Any: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def update(self, datasource_id: str, *, request: AppModelsRequestDatasource) -> AppModelsResponseDatasource: + def update( + self, + datasource_id: str, + *, + request: AppModelsRequestDatasource, + request_options: typing.Optional[RequestOptions] = None, + ) -> AppModelsResponseDatasource: """ Update a specific datasource @@ -131,13 +230,36 @@ def update(self, datasource_id: str, *, request: AppModelsRequestDatasource) -> - datasource_id: str. - request: AppModelsRequestDatasource. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = self._client_wrapper.httpx_client.request( "PATCH", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/datasources/{datasource_id}"), - json=jsonable_encoder(request), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/datasources/{jsonable_encoder(datasource_id)}" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseDatasource, _response.json()) # type: ignore @@ -154,7 +276,13 @@ class AsyncDatasourceClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - async def list(self, *, skip: typing.Optional[int] = None, take: typing.Optional[int] = None) -> DatasourceList: + async def list( + self, + *, + skip: typing.Optional[int] = None, + take: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> DatasourceList: """ List all datasources @@ -162,13 +290,38 @@ async def list(self, *, skip: typing.Optional[int] = None, take: typing.Optional - skip: typing.Optional[int]. - take: typing.Optional[int]. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = await self._client_wrapper.httpx_client.request( "GET", urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/datasources"), - params=remove_none_from_dict({"skip": skip, "take": take}), - headers=self._client_wrapper.get_headers(), - timeout=60, + params=jsonable_encoder( + remove_none_from_dict( + { + "skip": skip, + "take": take, + **( + request_options.get("additional_query_parameters", {}) + if request_options is not None + else {} + ), + } + ) + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(DatasourceList, _response.json()) # type: ignore @@ -180,19 +333,42 @@ async def list(self, *, skip: typing.Optional[int] = None, take: typing.Optional raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def create(self, *, request: AppModelsRequestDatasource) -> AppModelsResponseDatasource: + async def create( + self, *, request: AppModelsRequestDatasource, request_options: typing.Optional[RequestOptions] = None + ) -> AppModelsResponseDatasource: """ Create a new datasource Parameters: - request: AppModelsRequestDatasource. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = await self._client_wrapper.httpx_client.request( "POST", urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/datasources"), - json=jsonable_encoder(request), - headers=self._client_wrapper.get_headers(), - timeout=60, + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseDatasource, _response.json()) # type: ignore @@ -204,18 +380,38 @@ async def create(self, *, request: AppModelsRequestDatasource) -> AppModelsRespo raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def get(self, datasource_id: str) -> AppModelsResponseDatasource: + async def get( + self, datasource_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AppModelsResponseDatasource: """ Get a specific datasource Parameters: - datasource_id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = await self._client_wrapper.httpx_client.request( "GET", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/datasources/{datasource_id}"), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/datasources/{jsonable_encoder(datasource_id)}" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseDatasource, _response.json()) # type: ignore @@ -227,18 +423,38 @@ async def get(self, datasource_id: str) -> AppModelsResponseDatasource: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def delete(self, datasource_id: str) -> typing.Any: + async def delete( + self, datasource_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> typing.Any: """ Delete a specific datasource Parameters: - datasource_id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = await self._client_wrapper.httpx_client.request( "DELETE", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/datasources/{datasource_id}"), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/datasources/{jsonable_encoder(datasource_id)}" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore @@ -250,7 +466,13 @@ async def delete(self, datasource_id: str) -> typing.Any: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def update(self, datasource_id: str, *, request: AppModelsRequestDatasource) -> AppModelsResponseDatasource: + async def update( + self, + datasource_id: str, + *, + request: AppModelsRequestDatasource, + request_options: typing.Optional[RequestOptions] = None, + ) -> AppModelsResponseDatasource: """ Update a specific datasource @@ -258,13 +480,36 @@ async def update(self, datasource_id: str, *, request: AppModelsRequestDatasourc - datasource_id: str. - request: AppModelsRequestDatasource. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = await self._client_wrapper.httpx_client.request( "PATCH", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/datasources/{datasource_id}"), - json=jsonable_encoder(request), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/datasources/{jsonable_encoder(datasource_id)}" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseDatasource, _response.json()) # type: ignore diff --git a/src/superagent/resources/llm/client.py b/src/superagent/resources/llm/client.py index d72f7ee..a460274 100644 --- a/src/superagent/resources/llm/client.py +++ b/src/superagent/resources/llm/client.py @@ -7,6 +7,8 @@ from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.jsonable_encoder import jsonable_encoder +from ...core.remove_none_from_dict import remove_none_from_dict +from ...core.request_options import RequestOptions from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.app_models_request_llm import AppModelsRequestLlm from ...types.app_models_response_llm import AppModelsResponseLlm @@ -26,15 +28,32 @@ class LlmClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def list(self) -> LlmList: + def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> LlmList: """ List all LLMs + + Parameters: + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = self._client_wrapper.httpx_client.request( "GET", urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/llms"), - headers=self._client_wrapper.get_headers(), - timeout=60, + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(LlmList, _response.json()) # type: ignore @@ -44,19 +63,42 @@ def list(self) -> LlmList: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def create(self, *, request: AppModelsRequestLlm) -> AppModelsResponseLlm: + def create( + self, *, request: AppModelsRequestLlm, request_options: typing.Optional[RequestOptions] = None + ) -> AppModelsResponseLlm: """ Create a new LLM Parameters: - request: AppModelsRequestLlm. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = self._client_wrapper.httpx_client.request( "POST", urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/llms"), - json=jsonable_encoder(request), - headers=self._client_wrapper.get_headers(), - timeout=60, + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseLlm, _response.json()) # type: ignore @@ -68,18 +110,34 @@ def create(self, *, request: AppModelsRequestLlm) -> AppModelsResponseLlm: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def get(self, llm_id: str) -> AppModelsResponseLlm: + def get(self, llm_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> AppModelsResponseLlm: """ Get a single LLM Parameters: - llm_id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = self._client_wrapper.httpx_client.request( "GET", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/llms/{llm_id}"), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/llms/{jsonable_encoder(llm_id)}"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseLlm, _response.json()) # type: ignore @@ -91,7 +149,9 @@ def get(self, llm_id: str) -> AppModelsResponseLlm: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def update(self, llm_id: str, *, request: AppModelsRequestLlm) -> AppModelsResponseLlm: + def update( + self, llm_id: str, *, request: AppModelsRequestLlm, request_options: typing.Optional[RequestOptions] = None + ) -> AppModelsResponseLlm: """ Patch an LLM @@ -99,13 +159,34 @@ def update(self, llm_id: str, *, request: AppModelsRequestLlm) -> AppModelsRespo - llm_id: str. - request: AppModelsRequestLlm. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = self._client_wrapper.httpx_client.request( "PATCH", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/llms/{llm_id}"), - json=jsonable_encoder(request), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/llms/{jsonable_encoder(llm_id)}"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseLlm, _response.json()) # type: ignore @@ -122,15 +203,32 @@ class AsyncLlmClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - async def list(self) -> LlmList: + async def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> LlmList: """ List all LLMs + + Parameters: + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = await self._client_wrapper.httpx_client.request( "GET", urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/llms"), - headers=self._client_wrapper.get_headers(), - timeout=60, + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(LlmList, _response.json()) # type: ignore @@ -140,19 +238,42 @@ async def list(self) -> LlmList: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def create(self, *, request: AppModelsRequestLlm) -> AppModelsResponseLlm: + async def create( + self, *, request: AppModelsRequestLlm, request_options: typing.Optional[RequestOptions] = None + ) -> AppModelsResponseLlm: """ Create a new LLM Parameters: - request: AppModelsRequestLlm. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = await self._client_wrapper.httpx_client.request( "POST", urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/llms"), - json=jsonable_encoder(request), - headers=self._client_wrapper.get_headers(), - timeout=60, + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseLlm, _response.json()) # type: ignore @@ -164,18 +285,36 @@ async def create(self, *, request: AppModelsRequestLlm) -> AppModelsResponseLlm: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def get(self, llm_id: str) -> AppModelsResponseLlm: + async def get( + self, llm_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AppModelsResponseLlm: """ Get a single LLM Parameters: - llm_id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = await self._client_wrapper.httpx_client.request( "GET", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/llms/{llm_id}"), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/llms/{jsonable_encoder(llm_id)}"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseLlm, _response.json()) # type: ignore @@ -187,7 +326,9 @@ async def get(self, llm_id: str) -> AppModelsResponseLlm: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def update(self, llm_id: str, *, request: AppModelsRequestLlm) -> AppModelsResponseLlm: + async def update( + self, llm_id: str, *, request: AppModelsRequestLlm, request_options: typing.Optional[RequestOptions] = None + ) -> AppModelsResponseLlm: """ Patch an LLM @@ -195,13 +336,34 @@ async def update(self, llm_id: str, *, request: AppModelsRequestLlm) -> AppModel - llm_id: str. - request: AppModelsRequestLlm. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = await self._client_wrapper.httpx_client.request( "PATCH", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/llms/{llm_id}"), - json=jsonable_encoder(request), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/llms/{jsonable_encoder(llm_id)}"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseLlm, _response.json()) # type: ignore diff --git a/src/superagent/resources/tool/client.py b/src/superagent/resources/tool/client.py index d43949f..69a444a 100644 --- a/src/superagent/resources/tool/client.py +++ b/src/superagent/resources/tool/client.py @@ -8,6 +8,7 @@ from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.jsonable_encoder import jsonable_encoder from ...core.remove_none_from_dict import remove_none_from_dict +from ...core.request_options import RequestOptions from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.app_models_response_tool import AppModelsResponseTool from ...types.http_validation_error import HttpValidationError @@ -26,7 +27,13 @@ class ToolClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def list(self, *, skip: typing.Optional[int] = None, take: typing.Optional[int] = None) -> ToolList: + def list( + self, + *, + skip: typing.Optional[int] = None, + take: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> ToolList: """ List all tools @@ -34,13 +41,38 @@ def list(self, *, skip: typing.Optional[int] = None, take: typing.Optional[int] - skip: typing.Optional[int]. - take: typing.Optional[int]. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = self._client_wrapper.httpx_client.request( "GET", urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/tools"), - params=remove_none_from_dict({"skip": skip, "take": take}), - headers=self._client_wrapper.get_headers(), - timeout=60, + params=jsonable_encoder( + remove_none_from_dict( + { + "skip": skip, + "take": take, + **( + request_options.get("additional_query_parameters", {}) + if request_options is not None + else {} + ), + } + ) + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(ToolList, _response.json()) # type: ignore @@ -60,6 +92,7 @@ def create( type: str, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, return_direct: typing.Optional[bool] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> AppModelsResponseTool: """ Create a new tool @@ -74,6 +107,8 @@ def create( - metadata: typing.Optional[typing.Dict[str, typing.Any]]. - return_direct: typing.Optional[bool]. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _request: typing.Dict[str, typing.Any] = {"name": name, "type": type} if description is not OMIT: @@ -85,9 +120,28 @@ def create( _response = self._client_wrapper.httpx_client.request( "POST", urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/tools"), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=60, + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(_request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(_request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseTool, _response.json()) # type: ignore @@ -99,18 +153,36 @@ def create( raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def get(self, tool_id: str) -> AppModelsResponseTool: + def get(self, tool_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> AppModelsResponseTool: """ Get a specific tool Parameters: - tool_id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = self._client_wrapper.httpx_client.request( "GET", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/tools/{tool_id}"), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/tools/{jsonable_encoder(tool_id)}" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseTool, _response.json()) # type: ignore @@ -122,18 +194,36 @@ def get(self, tool_id: str) -> AppModelsResponseTool: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def delete(self, tool_id: str) -> typing.Any: + def delete(self, tool_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any: """ Delete a specific tool Parameters: - tool_id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = self._client_wrapper.httpx_client.request( "DELETE", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/tools/{tool_id}"), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/tools/{jsonable_encoder(tool_id)}" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore @@ -154,6 +244,7 @@ def update( type: typing.Optional[str] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, return_direct: typing.Optional[bool] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> AppModelsResponseTool: """ Update a specific tool @@ -170,6 +261,8 @@ def update( - metadata: typing.Optional[typing.Dict[str, typing.Any]]. - return_direct: typing.Optional[bool]. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _request: typing.Dict[str, typing.Any] = {} if name is not OMIT: @@ -184,10 +277,31 @@ def update( _request["returnDirect"] = return_direct _response = self._client_wrapper.httpx_client.request( "PATCH", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/tools/{tool_id}"), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/tools/{jsonable_encoder(tool_id)}" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(_request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(_request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseTool, _response.json()) # type: ignore @@ -204,7 +318,13 @@ class AsyncToolClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - async def list(self, *, skip: typing.Optional[int] = None, take: typing.Optional[int] = None) -> ToolList: + async def list( + self, + *, + skip: typing.Optional[int] = None, + take: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> ToolList: """ List all tools @@ -212,13 +332,38 @@ async def list(self, *, skip: typing.Optional[int] = None, take: typing.Optional - skip: typing.Optional[int]. - take: typing.Optional[int]. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = await self._client_wrapper.httpx_client.request( "GET", urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/tools"), - params=remove_none_from_dict({"skip": skip, "take": take}), - headers=self._client_wrapper.get_headers(), - timeout=60, + params=jsonable_encoder( + remove_none_from_dict( + { + "skip": skip, + "take": take, + **( + request_options.get("additional_query_parameters", {}) + if request_options is not None + else {} + ), + } + ) + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(ToolList, _response.json()) # type: ignore @@ -238,6 +383,7 @@ async def create( type: str, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, return_direct: typing.Optional[bool] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> AppModelsResponseTool: """ Create a new tool @@ -252,6 +398,8 @@ async def create( - metadata: typing.Optional[typing.Dict[str, typing.Any]]. - return_direct: typing.Optional[bool]. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _request: typing.Dict[str, typing.Any] = {"name": name, "type": type} if description is not OMIT: @@ -263,9 +411,28 @@ async def create( _response = await self._client_wrapper.httpx_client.request( "POST", urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/tools"), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=60, + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(_request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(_request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseTool, _response.json()) # type: ignore @@ -277,18 +444,38 @@ async def create( raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def get(self, tool_id: str) -> AppModelsResponseTool: + async def get( + self, tool_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AppModelsResponseTool: """ Get a specific tool Parameters: - tool_id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = await self._client_wrapper.httpx_client.request( "GET", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/tools/{tool_id}"), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/tools/{jsonable_encoder(tool_id)}" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseTool, _response.json()) # type: ignore @@ -300,18 +487,36 @@ async def get(self, tool_id: str) -> AppModelsResponseTool: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def delete(self, tool_id: str) -> typing.Any: + async def delete(self, tool_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any: """ Delete a specific tool Parameters: - tool_id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = await self._client_wrapper.httpx_client.request( "DELETE", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/tools/{tool_id}"), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/tools/{jsonable_encoder(tool_id)}" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore @@ -332,6 +537,7 @@ async def update( type: typing.Optional[str] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, return_direct: typing.Optional[bool] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> AppModelsResponseTool: """ Update a specific tool @@ -348,6 +554,8 @@ async def update( - metadata: typing.Optional[typing.Dict[str, typing.Any]]. - return_direct: typing.Optional[bool]. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _request: typing.Dict[str, typing.Any] = {} if name is not OMIT: @@ -362,10 +570,31 @@ async def update( _request["returnDirect"] = return_direct _response = await self._client_wrapper.httpx_client.request( "PATCH", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/tools/{tool_id}"), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/tools/{jsonable_encoder(tool_id)}" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(_request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(_request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseTool, _response.json()) # type: ignore diff --git a/src/superagent/resources/vector_database/client.py b/src/superagent/resources/vector_database/client.py index 5652e71..0a0a2e2 100644 --- a/src/superagent/resources/vector_database/client.py +++ b/src/superagent/resources/vector_database/client.py @@ -7,6 +7,8 @@ from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.jsonable_encoder import jsonable_encoder +from ...core.remove_none_from_dict import remove_none_from_dict +from ...core.request_options import RequestOptions from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.app_models_request_vector_db import AppModelsRequestVectorDb from ...types.app_models_response_vector_db import AppModelsResponseVectorDb @@ -26,19 +28,42 @@ class VectorDatabaseClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def create(self, *, request: AppModelsRequestVectorDb) -> AppModelsResponseVectorDb: + def create( + self, *, request: AppModelsRequestVectorDb, request_options: typing.Optional[RequestOptions] = None + ) -> AppModelsResponseVectorDb: """ Create a new Vector Database Parameters: - request: AppModelsRequestVectorDb. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = self._client_wrapper.httpx_client.request( "POST", urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/vector-db"), - json=jsonable_encoder(request), - headers=self._client_wrapper.get_headers(), - timeout=60, + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseVectorDb, _response.json()) # type: ignore @@ -50,15 +75,32 @@ def create(self, *, request: AppModelsRequestVectorDb) -> AppModelsResponseVecto raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def list(self) -> VectorDbList: + def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> VectorDbList: """ List all Vector Databases + + Parameters: + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = self._client_wrapper.httpx_client.request( "GET", urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/vector-dbs"), - headers=self._client_wrapper.get_headers(), - timeout=60, + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(VectorDbList, _response.json()) # type: ignore @@ -68,18 +110,38 @@ def list(self) -> VectorDbList: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def get(self, vector_db_id: str) -> AppModelsResponseVectorDb: + def get( + self, vector_db_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AppModelsResponseVectorDb: """ Get a single Vector Database Parameters: - vector_db_id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = self._client_wrapper.httpx_client.request( "GET", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/vector-dbs/{vector_db_id}"), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/vector-dbs/{jsonable_encoder(vector_db_id)}" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseVectorDb, _response.json()) # type: ignore @@ -91,7 +153,13 @@ def get(self, vector_db_id: str) -> AppModelsResponseVectorDb: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def update(self, vector_db_id: str, *, request: AppModelsRequestVectorDb) -> AppModelsResponseVectorDb: + def update( + self, + vector_db_id: str, + *, + request: AppModelsRequestVectorDb, + request_options: typing.Optional[RequestOptions] = None, + ) -> AppModelsResponseVectorDb: """ Patch a Vector Database @@ -99,13 +167,36 @@ def update(self, vector_db_id: str, *, request: AppModelsRequestVectorDb) -> App - vector_db_id: str. - request: AppModelsRequestVectorDb. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = self._client_wrapper.httpx_client.request( "PATCH", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/vector-dbs/{vector_db_id}"), - json=jsonable_encoder(request), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/vector-dbs/{jsonable_encoder(vector_db_id)}" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseVectorDb, _response.json()) # type: ignore @@ -122,19 +213,42 @@ class AsyncVectorDatabaseClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - async def create(self, *, request: AppModelsRequestVectorDb) -> AppModelsResponseVectorDb: + async def create( + self, *, request: AppModelsRequestVectorDb, request_options: typing.Optional[RequestOptions] = None + ) -> AppModelsResponseVectorDb: """ Create a new Vector Database Parameters: - request: AppModelsRequestVectorDb. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = await self._client_wrapper.httpx_client.request( "POST", urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/vector-db"), - json=jsonable_encoder(request), - headers=self._client_wrapper.get_headers(), - timeout=60, + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseVectorDb, _response.json()) # type: ignore @@ -146,15 +260,32 @@ async def create(self, *, request: AppModelsRequestVectorDb) -> AppModelsRespons raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def list(self) -> VectorDbList: + async def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> VectorDbList: """ List all Vector Databases + + Parameters: + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = await self._client_wrapper.httpx_client.request( "GET", urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/vector-dbs"), - headers=self._client_wrapper.get_headers(), - timeout=60, + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(VectorDbList, _response.json()) # type: ignore @@ -164,18 +295,38 @@ async def list(self) -> VectorDbList: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def get(self, vector_db_id: str) -> AppModelsResponseVectorDb: + async def get( + self, vector_db_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AppModelsResponseVectorDb: """ Get a single Vector Database Parameters: - vector_db_id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = await self._client_wrapper.httpx_client.request( "GET", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/vector-dbs/{vector_db_id}"), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/vector-dbs/{jsonable_encoder(vector_db_id)}" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseVectorDb, _response.json()) # type: ignore @@ -187,7 +338,13 @@ async def get(self, vector_db_id: str) -> AppModelsResponseVectorDb: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def update(self, vector_db_id: str, *, request: AppModelsRequestVectorDb) -> AppModelsResponseVectorDb: + async def update( + self, + vector_db_id: str, + *, + request: AppModelsRequestVectorDb, + request_options: typing.Optional[RequestOptions] = None, + ) -> AppModelsResponseVectorDb: """ Patch a Vector Database @@ -195,13 +352,36 @@ async def update(self, vector_db_id: str, *, request: AppModelsRequestVectorDb) - vector_db_id: str. - request: AppModelsRequestVectorDb. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = await self._client_wrapper.httpx_client.request( "PATCH", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/vector-dbs/{vector_db_id}"), - json=jsonable_encoder(request), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/vector-dbs/{jsonable_encoder(vector_db_id)}" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseVectorDb, _response.json()) # type: ignore diff --git a/src/superagent/resources/workflow/client.py b/src/superagent/resources/workflow/client.py index 387ac75..5c3d88e 100644 --- a/src/superagent/resources/workflow/client.py +++ b/src/superagent/resources/workflow/client.py @@ -8,6 +8,7 @@ from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.jsonable_encoder import jsonable_encoder from ...core.remove_none_from_dict import remove_none_from_dict +from ...core.request_options import RequestOptions from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.app_models_request_workflow import AppModelsRequestWorkflow from ...types.app_models_request_workflow_step import AppModelsRequestWorkflowStep @@ -30,7 +31,13 @@ class WorkflowClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def list(self, *, skip: typing.Optional[int] = None, take: typing.Optional[int] = None) -> WorkflowList: + def list( + self, + *, + skip: typing.Optional[int] = None, + take: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> WorkflowList: """ List all workflows @@ -38,13 +45,38 @@ def list(self, *, skip: typing.Optional[int] = None, take: typing.Optional[int] - skip: typing.Optional[int]. - take: typing.Optional[int]. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = self._client_wrapper.httpx_client.request( "GET", urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/workflows"), - params=remove_none_from_dict({"skip": skip, "take": take}), - headers=self._client_wrapper.get_headers(), - timeout=60, + params=jsonable_encoder( + remove_none_from_dict( + { + "skip": skip, + "take": take, + **( + request_options.get("additional_query_parameters", {}) + if request_options is not None + else {} + ), + } + ) + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(WorkflowList, _response.json()) # type: ignore @@ -56,19 +88,42 @@ def list(self, *, skip: typing.Optional[int] = None, take: typing.Optional[int] raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def create(self, *, request: AppModelsRequestWorkflow) -> AppModelsResponseWorkflow: + def create( + self, *, request: AppModelsRequestWorkflow, request_options: typing.Optional[RequestOptions] = None + ) -> AppModelsResponseWorkflow: """ Create a new workflow Parameters: - request: AppModelsRequestWorkflow. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = self._client_wrapper.httpx_client.request( "POST", urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/workflows"), - json=jsonable_encoder(request), - headers=self._client_wrapper.get_headers(), - timeout=60, + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseWorkflow, _response.json()) # type: ignore @@ -80,18 +135,38 @@ def create(self, *, request: AppModelsRequestWorkflow) -> AppModelsResponseWorkf raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def get(self, workflow_id: str) -> AppModelsResponseWorkflow: + def get( + self, workflow_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AppModelsResponseWorkflow: """ Get a single workflow Parameters: - workflow_id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = self._client_wrapper.httpx_client.request( "GET", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/workflows/{workflow_id}"), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/workflows/{jsonable_encoder(workflow_id)}" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseWorkflow, _response.json()) # type: ignore @@ -103,18 +178,36 @@ def get(self, workflow_id: str) -> AppModelsResponseWorkflow: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def delete(self, workflow_id: str) -> typing.Any: + def delete(self, workflow_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any: """ Delete a specific workflow Parameters: - workflow_id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = self._client_wrapper.httpx_client.request( "DELETE", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/workflows/{workflow_id}"), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/workflows/{jsonable_encoder(workflow_id)}" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore @@ -127,7 +220,12 @@ def delete(self, workflow_id: str) -> typing.Any: raise ApiError(status_code=_response.status_code, body=_response_json) def update( - self, workflow_id: str, step_id: str, *, request: AppModelsRequestWorkflowStep + self, + workflow_id: str, + step_id: str, + *, + request: AppModelsRequestWorkflowStep, + request_options: typing.Optional[RequestOptions] = None, ) -> AppModelsResponseWorkflowStep: """ Patch a workflow step @@ -138,15 +236,37 @@ def update( - step_id: str. - request: AppModelsRequestWorkflowStep. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = self._client_wrapper.httpx_client.request( "PATCH", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"api/v1/workflows/{workflow_id}/steps/{step_id}" + f"{self._client_wrapper.get_base_url()}/", + f"api/v1/workflows/{jsonable_encoder(workflow_id)}/steps/{jsonable_encoder(step_id)}", + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None ), - json=jsonable_encoder(request), - headers=self._client_wrapper.get_headers(), - timeout=60, + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseWorkflowStep, _response.json()) # type: ignore @@ -159,7 +279,13 @@ def update( raise ApiError(status_code=_response.status_code, body=_response_json) def invoke( - self, workflow_id: str, *, input: str, enable_streaming: bool, session_id: typing.Optional[str] = OMIT + self, + workflow_id: str, + *, + input: str, + enable_streaming: bool, + session_id: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> typing.Any: """ Invoke a specific workflow @@ -172,16 +298,39 @@ def invoke( - enable_streaming: bool. - session_id: typing.Optional[str]. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _request: typing.Dict[str, typing.Any] = {"input": input, "enableStreaming": enable_streaming} if session_id is not OMIT: _request["sessionId"] = session_id _response = self._client_wrapper.httpx_client.request( "POST", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/workflows/{workflow_id}/invoke"), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/workflows/{jsonable_encoder(workflow_id)}/invoke" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(_request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(_request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore @@ -193,18 +342,38 @@ def invoke( raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def list_steps(self, workflow_id: str) -> WorkflowStepList: + def list_steps( + self, workflow_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> WorkflowStepList: """ List all steps of a workflow Parameters: - workflow_id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = self._client_wrapper.httpx_client.request( "GET", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/workflows/{workflow_id}/steps"), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/workflows/{jsonable_encoder(workflow_id)}/steps" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(WorkflowStepList, _response.json()) # type: ignore @@ -216,7 +385,13 @@ def list_steps(self, workflow_id: str) -> WorkflowStepList: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def add_step(self, workflow_id: str, *, request: AppModelsRequestWorkflowStep) -> AppModelsResponseWorkflowStep: + def add_step( + self, + workflow_id: str, + *, + request: AppModelsRequestWorkflowStep, + request_options: typing.Optional[RequestOptions] = None, + ) -> AppModelsResponseWorkflowStep: """ Create a new workflow step @@ -224,13 +399,36 @@ def add_step(self, workflow_id: str, *, request: AppModelsRequestWorkflowStep) - - workflow_id: str. - request: AppModelsRequestWorkflowStep. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = self._client_wrapper.httpx_client.request( "POST", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/workflows/{workflow_id}/steps"), - json=jsonable_encoder(request), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/workflows/{jsonable_encoder(workflow_id)}/steps" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseWorkflowStep, _response.json()) # type: ignore @@ -242,7 +440,9 @@ def add_step(self, workflow_id: str, *, request: AppModelsRequestWorkflowStep) - raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def delete_step(self, workflow_id: str, step_id: str) -> typing.Any: + def delete_step( + self, workflow_id: str, step_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> typing.Any: """ Delete a specific workflow step @@ -250,14 +450,31 @@ def delete_step(self, workflow_id: str, step_id: str) -> typing.Any: - workflow_id: str. - step_id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = self._client_wrapper.httpx_client.request( "DELETE", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"api/v1/workflows/{workflow_id}/steps/{step_id}" + f"{self._client_wrapper.get_base_url()}/", + f"api/v1/workflows/{jsonable_encoder(workflow_id)}/steps/{jsonable_encoder(step_id)}", + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) ), - headers=self._client_wrapper.get_headers(), - timeout=60, + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore @@ -274,7 +491,13 @@ class AsyncWorkflowClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - async def list(self, *, skip: typing.Optional[int] = None, take: typing.Optional[int] = None) -> WorkflowList: + async def list( + self, + *, + skip: typing.Optional[int] = None, + take: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> WorkflowList: """ List all workflows @@ -282,13 +505,38 @@ async def list(self, *, skip: typing.Optional[int] = None, take: typing.Optional - skip: typing.Optional[int]. - take: typing.Optional[int]. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = await self._client_wrapper.httpx_client.request( "GET", urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/workflows"), - params=remove_none_from_dict({"skip": skip, "take": take}), - headers=self._client_wrapper.get_headers(), - timeout=60, + params=jsonable_encoder( + remove_none_from_dict( + { + "skip": skip, + "take": take, + **( + request_options.get("additional_query_parameters", {}) + if request_options is not None + else {} + ), + } + ) + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(WorkflowList, _response.json()) # type: ignore @@ -300,19 +548,42 @@ async def list(self, *, skip: typing.Optional[int] = None, take: typing.Optional raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def create(self, *, request: AppModelsRequestWorkflow) -> AppModelsResponseWorkflow: + async def create( + self, *, request: AppModelsRequestWorkflow, request_options: typing.Optional[RequestOptions] = None + ) -> AppModelsResponseWorkflow: """ Create a new workflow Parameters: - request: AppModelsRequestWorkflow. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = await self._client_wrapper.httpx_client.request( "POST", urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/workflows"), - json=jsonable_encoder(request), - headers=self._client_wrapper.get_headers(), - timeout=60, + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseWorkflow, _response.json()) # type: ignore @@ -324,18 +595,38 @@ async def create(self, *, request: AppModelsRequestWorkflow) -> AppModelsRespons raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def get(self, workflow_id: str) -> AppModelsResponseWorkflow: + async def get( + self, workflow_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AppModelsResponseWorkflow: """ Get a single workflow Parameters: - workflow_id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = await self._client_wrapper.httpx_client.request( "GET", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/workflows/{workflow_id}"), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/workflows/{jsonable_encoder(workflow_id)}" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseWorkflow, _response.json()) # type: ignore @@ -347,18 +638,36 @@ async def get(self, workflow_id: str) -> AppModelsResponseWorkflow: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def delete(self, workflow_id: str) -> typing.Any: + async def delete(self, workflow_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any: """ Delete a specific workflow Parameters: - workflow_id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = await self._client_wrapper.httpx_client.request( "DELETE", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/workflows/{workflow_id}"), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/workflows/{jsonable_encoder(workflow_id)}" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore @@ -371,7 +680,12 @@ async def delete(self, workflow_id: str) -> typing.Any: raise ApiError(status_code=_response.status_code, body=_response_json) async def update( - self, workflow_id: str, step_id: str, *, request: AppModelsRequestWorkflowStep + self, + workflow_id: str, + step_id: str, + *, + request: AppModelsRequestWorkflowStep, + request_options: typing.Optional[RequestOptions] = None, ) -> AppModelsResponseWorkflowStep: """ Patch a workflow step @@ -382,15 +696,37 @@ async def update( - step_id: str. - request: AppModelsRequestWorkflowStep. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = await self._client_wrapper.httpx_client.request( "PATCH", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"api/v1/workflows/{workflow_id}/steps/{step_id}" + f"{self._client_wrapper.get_base_url()}/", + f"api/v1/workflows/{jsonable_encoder(workflow_id)}/steps/{jsonable_encoder(step_id)}", + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) ), - json=jsonable_encoder(request), - headers=self._client_wrapper.get_headers(), - timeout=60, + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseWorkflowStep, _response.json()) # type: ignore @@ -403,7 +739,13 @@ async def update( raise ApiError(status_code=_response.status_code, body=_response_json) async def invoke( - self, workflow_id: str, *, input: str, enable_streaming: bool, session_id: typing.Optional[str] = OMIT + self, + workflow_id: str, + *, + input: str, + enable_streaming: bool, + session_id: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, ) -> typing.Any: """ Invoke a specific workflow @@ -416,16 +758,39 @@ async def invoke( - enable_streaming: bool. - session_id: typing.Optional[str]. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _request: typing.Dict[str, typing.Any] = {"input": input, "enableStreaming": enable_streaming} if session_id is not OMIT: _request["sessionId"] = session_id _response = await self._client_wrapper.httpx_client.request( "POST", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/workflows/{workflow_id}/invoke"), - json=jsonable_encoder(_request), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/workflows/{jsonable_encoder(workflow_id)}/invoke" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(_request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(_request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore @@ -437,18 +802,38 @@ async def invoke( raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def list_steps(self, workflow_id: str) -> WorkflowStepList: + async def list_steps( + self, workflow_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> WorkflowStepList: """ List all steps of a workflow Parameters: - workflow_id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = await self._client_wrapper.httpx_client.request( "GET", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/workflows/{workflow_id}/steps"), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/workflows/{jsonable_encoder(workflow_id)}/steps" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(WorkflowStepList, _response.json()) # type: ignore @@ -461,7 +846,11 @@ async def list_steps(self, workflow_id: str) -> WorkflowStepList: raise ApiError(status_code=_response.status_code, body=_response_json) async def add_step( - self, workflow_id: str, *, request: AppModelsRequestWorkflowStep + self, + workflow_id: str, + *, + request: AppModelsRequestWorkflowStep, + request_options: typing.Optional[RequestOptions] = None, ) -> AppModelsResponseWorkflowStep: """ Create a new workflow step @@ -470,13 +859,36 @@ async def add_step( - workflow_id: str. - request: AppModelsRequestWorkflowStep. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = await self._client_wrapper.httpx_client.request( "POST", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/workflows/{workflow_id}/steps"), - json=jsonable_encoder(request), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/workflows/{jsonable_encoder(workflow_id)}/steps" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(AppModelsResponseWorkflowStep, _response.json()) # type: ignore @@ -488,7 +900,9 @@ async def add_step( raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def delete_step(self, workflow_id: str, step_id: str) -> typing.Any: + async def delete_step( + self, workflow_id: str, step_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> typing.Any: """ Delete a specific workflow step @@ -496,14 +910,31 @@ async def delete_step(self, workflow_id: str, step_id: str) -> typing.Any: - workflow_id: str. - step_id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = await self._client_wrapper.httpx_client.request( "DELETE", urllib.parse.urljoin( - f"{self._client_wrapper.get_base_url()}/", f"api/v1/workflows/{workflow_id}/steps/{step_id}" + f"{self._client_wrapper.get_base_url()}/", + f"api/v1/workflows/{jsonable_encoder(workflow_id)}/steps/{jsonable_encoder(step_id)}", + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) ), - headers=self._client_wrapper.get_headers(), - timeout=60, + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore diff --git a/src/superagent/resources/workflow_config/client.py b/src/superagent/resources/workflow_config/client.py index 4c41c98..8572573 100644 --- a/src/superagent/resources/workflow_config/client.py +++ b/src/superagent/resources/workflow_config/client.py @@ -6,6 +6,9 @@ from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ...core.jsonable_encoder import jsonable_encoder +from ...core.remove_none_from_dict import remove_none_from_dict +from ...core.request_options import RequestOptions from ...errors.unprocessable_entity_error import UnprocessableEntityError from ...types.http_validation_error import HttpValidationError @@ -19,12 +22,30 @@ class WorkflowConfigClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def get_schema(self) -> typing.Any: + def get_schema(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any: + """ + Parameters: + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ _response = self._client_wrapper.httpx_client.request( "GET", urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/workflows/config/schema"), - headers=self._client_wrapper.get_headers(), - timeout=60, + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore @@ -34,16 +55,37 @@ def get_schema(self) -> typing.Any: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - def add_config(self, workflow_id: str) -> typing.Any: + def add_config(self, workflow_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any: """ Parameters: - workflow_id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = self._client_wrapper.httpx_client.request( "POST", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/workflows/{workflow_id}/config"), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/workflows/{jsonable_encoder(workflow_id)}/config" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {}))) + if request_options is not None + else None, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore @@ -60,12 +102,30 @@ class AsyncWorkflowConfigClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - async def get_schema(self) -> typing.Any: + async def get_schema(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any: + """ + Parameters: + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ _response = await self._client_wrapper.httpx_client.request( "GET", urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/workflows/config/schema"), - headers=self._client_wrapper.get_headers(), - timeout=60, + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore @@ -75,16 +135,39 @@ async def get_schema(self) -> typing.Any: raise ApiError(status_code=_response.status_code, body=_response.text) raise ApiError(status_code=_response.status_code, body=_response_json) - async def add_config(self, workflow_id: str) -> typing.Any: + async def add_config( + self, workflow_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> typing.Any: """ Parameters: - workflow_id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _response = await self._client_wrapper.httpx_client.request( "POST", - urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/workflows/{workflow_id}/config"), - headers=self._client_wrapper.get_headers(), - timeout=60, + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", f"api/v1/workflows/{jsonable_encoder(workflow_id)}/config" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {}))) + if request_options is not None + else None, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore ) if 200 <= _response.status_code < 300: return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore diff --git a/src/superagent/types/agent_datasosurce_list.py b/src/superagent/types/agent_datasosurce_list.py index 9d1ccb8..3e3181e 100644 --- a/src/superagent/types/agent_datasosurce_list.py +++ b/src/superagent/types/agent_datasosurce_list.py @@ -14,7 +14,7 @@ class AgentDatasosurceList(pydantic.BaseModel): success: bool - data: typing.Optional[typing.List[PrismaModelsAgentDatasource]] + data: typing.Optional[typing.List[PrismaModelsAgentDatasource]] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/src/superagent/types/agent_list.py b/src/superagent/types/agent_list.py index 56ca7aa..8f4b28b 100644 --- a/src/superagent/types/agent_list.py +++ b/src/superagent/types/agent_list.py @@ -14,7 +14,7 @@ class AgentList(pydantic.BaseModel): success: bool - data: typing.Optional[typing.List[PrismaModelsAgent]] + data: typing.Optional[typing.List[PrismaModelsAgent]] = None total_pages: int def json(self, **kwargs: typing.Any) -> str: diff --git a/src/superagent/types/agent_tool_list.py b/src/superagent/types/agent_tool_list.py index 2a7281a..cdc8ea7 100644 --- a/src/superagent/types/agent_tool_list.py +++ b/src/superagent/types/agent_tool_list.py @@ -14,7 +14,7 @@ class AgentToolList(pydantic.BaseModel): success: bool - data: typing.Optional[typing.List[PrismaModelsAgentTool]] + data: typing.Optional[typing.List[PrismaModelsAgentTool]] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/src/superagent/types/api_key_create.py b/src/superagent/types/api_key_create.py index a9da6bb..7f7d55b 100644 --- a/src/superagent/types/api_key_create.py +++ b/src/superagent/types/api_key_create.py @@ -14,7 +14,7 @@ class ApiKeyCreate(pydantic.BaseModel): success: bool - data: typing.Optional[ApiKeyCreateModel] + data: typing.Optional[ApiKeyCreateModel] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/src/superagent/types/api_key_create_model.py b/src/superagent/types/api_key_create_model.py index db8b37f..495aedb 100644 --- a/src/superagent/types/api_key_create_model.py +++ b/src/superagent/types/api_key_create_model.py @@ -23,7 +23,7 @@ class ApiKeyCreateModel(pydantic.BaseModel): created_at: dt.datetime = pydantic.Field(alias="createdAt") updated_at: dt.datetime = pydantic.Field(alias="updatedAt") api_user_id: str = pydantic.Field(alias="apiUserId") - api_user: typing.Optional[PrismaModelsApiUser] = pydantic.Field(alias="apiUser") + api_user: typing.Optional[PrismaModelsApiUser] = pydantic.Field(alias="apiUser", default=None) api_key: str = pydantic.Field(alias="apiKey") def json(self, **kwargs: typing.Any) -> str: diff --git a/src/superagent/types/api_key_list.py b/src/superagent/types/api_key_list.py index 1fe1427..6eaa163 100644 --- a/src/superagent/types/api_key_list.py +++ b/src/superagent/types/api_key_list.py @@ -14,7 +14,7 @@ class ApiKeyList(pydantic.BaseModel): success: bool - data: typing.Optional[typing.List[PrismaModelsApiKey]] + data: typing.Optional[typing.List[PrismaModelsApiKey]] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/src/superagent/types/app_models_request_api_user.py b/src/superagent/types/app_models_request_api_user.py index 4e640d4..bf3f182 100644 --- a/src/superagent/types/app_models_request_api_user.py +++ b/src/superagent/types/app_models_request_api_user.py @@ -13,10 +13,10 @@ class AppModelsRequestApiUser(pydantic.BaseModel): email: str - first_name: typing.Optional[str] = pydantic.Field(alias="firstName") - last_name: typing.Optional[str] = pydantic.Field(alias="lastName") - company: typing.Optional[str] - anonymous_id: typing.Optional[str] = pydantic.Field(alias="anonymousId") + first_name: typing.Optional[str] = pydantic.Field(alias="firstName", default=None) + last_name: typing.Optional[str] = pydantic.Field(alias="lastName", default=None) + company: typing.Optional[str] = None + anonymous_id: typing.Optional[str] = pydantic.Field(alias="anonymousId", default=None) def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/src/superagent/types/app_models_request_datasource.py b/src/superagent/types/app_models_request_datasource.py index e792882..c74a478 100644 --- a/src/superagent/types/app_models_request_datasource.py +++ b/src/superagent/types/app_models_request_datasource.py @@ -13,12 +13,12 @@ class AppModelsRequestDatasource(pydantic.BaseModel): name: str - description: typing.Optional[str] + description: typing.Optional[str] = None type: str - content: typing.Optional[str] - url: typing.Optional[str] - metadata: typing.Optional[typing.Dict[str, typing.Any]] - vector_db_id: typing.Optional[str] = pydantic.Field(alias="vectorDbId") + content: typing.Optional[str] = None + url: typing.Optional[str] = None + metadata: typing.Optional[typing.Dict[str, typing.Any]] = None + vector_db_id: typing.Optional[str] = pydantic.Field(alias="vectorDbId", default=None) def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/src/superagent/types/app_models_request_llm.py b/src/superagent/types/app_models_request_llm.py index 88b10e1..966f7aa 100644 --- a/src/superagent/types/app_models_request_llm.py +++ b/src/superagent/types/app_models_request_llm.py @@ -14,7 +14,7 @@ class AppModelsRequestLlm(pydantic.BaseModel): provider: str api_key: str = pydantic.Field(alias="apiKey") - options: typing.Optional[typing.Dict[str, typing.Any]] + options: typing.Optional[typing.Dict[str, typing.Any]] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/src/superagent/types/app_models_response_agent.py b/src/superagent/types/app_models_response_agent.py index 032cf58..4b3e130 100644 --- a/src/superagent/types/app_models_response_agent.py +++ b/src/superagent/types/app_models_response_agent.py @@ -14,7 +14,7 @@ class AppModelsResponseAgent(pydantic.BaseModel): success: bool - data: typing.Optional[PrismaModelsAgent] + data: typing.Optional[PrismaModelsAgent] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/src/superagent/types/app_models_response_agent_invoke.py b/src/superagent/types/app_models_response_agent_invoke.py index ef70588..c8e5c64 100644 --- a/src/superagent/types/app_models_response_agent_invoke.py +++ b/src/superagent/types/app_models_response_agent_invoke.py @@ -13,7 +13,7 @@ class AppModelsResponseAgentInvoke(pydantic.BaseModel): success: bool - data: typing.Optional[typing.Any] + data: typing.Optional[typing.Any] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/src/superagent/types/app_models_response_api_key.py b/src/superagent/types/app_models_response_api_key.py index 1aa1489..bf803fb 100644 --- a/src/superagent/types/app_models_response_api_key.py +++ b/src/superagent/types/app_models_response_api_key.py @@ -14,7 +14,7 @@ class AppModelsResponseApiKey(pydantic.BaseModel): success: bool - data: typing.Optional[PrismaModelsApiKey] + data: typing.Optional[PrismaModelsApiKey] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/src/superagent/types/app_models_response_api_user.py b/src/superagent/types/app_models_response_api_user.py index 00ca6a9..e793e7c 100644 --- a/src/superagent/types/app_models_response_api_user.py +++ b/src/superagent/types/app_models_response_api_user.py @@ -14,7 +14,7 @@ class AppModelsResponseApiUser(pydantic.BaseModel): success: bool - data: typing.Optional[PrismaModelsApiUser] + data: typing.Optional[PrismaModelsApiUser] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/src/superagent/types/app_models_response_datasource.py b/src/superagent/types/app_models_response_datasource.py index d13d007..09ac454 100644 --- a/src/superagent/types/app_models_response_datasource.py +++ b/src/superagent/types/app_models_response_datasource.py @@ -14,7 +14,7 @@ class AppModelsResponseDatasource(pydantic.BaseModel): success: bool - data: typing.Optional[PrismaModelsDatasource] + data: typing.Optional[PrismaModelsDatasource] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/src/superagent/types/app_models_response_llm.py b/src/superagent/types/app_models_response_llm.py index b1bd499..0a5f094 100644 --- a/src/superagent/types/app_models_response_llm.py +++ b/src/superagent/types/app_models_response_llm.py @@ -14,7 +14,7 @@ class AppModelsResponseLlm(pydantic.BaseModel): success: bool - data: typing.Optional[PrismaModelsLlm] + data: typing.Optional[PrismaModelsLlm] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/src/superagent/types/app_models_response_tool.py b/src/superagent/types/app_models_response_tool.py index 2460771..d9be61a 100644 --- a/src/superagent/types/app_models_response_tool.py +++ b/src/superagent/types/app_models_response_tool.py @@ -14,7 +14,7 @@ class AppModelsResponseTool(pydantic.BaseModel): success: bool - data: typing.Optional[PrismaModelsTool] + data: typing.Optional[PrismaModelsTool] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/src/superagent/types/app_models_response_vector_db.py b/src/superagent/types/app_models_response_vector_db.py index f01bd9a..817cbe8 100644 --- a/src/superagent/types/app_models_response_vector_db.py +++ b/src/superagent/types/app_models_response_vector_db.py @@ -14,7 +14,7 @@ class AppModelsResponseVectorDb(pydantic.BaseModel): success: bool - data: typing.Optional[PrismaModelsVectorDb] + data: typing.Optional[PrismaModelsVectorDb] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/src/superagent/types/app_models_response_workflow.py b/src/superagent/types/app_models_response_workflow.py index e29faf0..eeca527 100644 --- a/src/superagent/types/app_models_response_workflow.py +++ b/src/superagent/types/app_models_response_workflow.py @@ -14,7 +14,7 @@ class AppModelsResponseWorkflow(pydantic.BaseModel): success: bool - data: typing.Optional[PrismaModelsWorkflow] + data: typing.Optional[PrismaModelsWorkflow] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/src/superagent/types/app_models_response_workflow_step.py b/src/superagent/types/app_models_response_workflow_step.py index 619a26a..5861b36 100644 --- a/src/superagent/types/app_models_response_workflow_step.py +++ b/src/superagent/types/app_models_response_workflow_step.py @@ -14,7 +14,7 @@ class AppModelsResponseWorkflowStep(pydantic.BaseModel): success: bool - data: typing.Optional[PrismaModelsWorkflowStep] + data: typing.Optional[PrismaModelsWorkflowStep] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/src/superagent/types/datasource_list.py b/src/superagent/types/datasource_list.py index 1d3b6c6..42bb36f 100644 --- a/src/superagent/types/datasource_list.py +++ b/src/superagent/types/datasource_list.py @@ -14,7 +14,7 @@ class DatasourceList(pydantic.BaseModel): success: bool - data: typing.Optional[typing.List[PrismaModelsDatasource]] + data: typing.Optional[typing.List[PrismaModelsDatasource]] = None total_pages: int def json(self, **kwargs: typing.Any) -> str: diff --git a/src/superagent/types/function_definition.py b/src/superagent/types/function_definition.py index c4431ef..844011e 100644 --- a/src/superagent/types/function_definition.py +++ b/src/superagent/types/function_definition.py @@ -12,9 +12,9 @@ class FunctionDefinition(pydantic.BaseModel): - name: typing.Optional[str] - description: typing.Optional[str] - parameters: typing.Optional[typing.Dict[str, typing.Any]] + name: typing.Optional[str] = None + description: typing.Optional[str] = None + parameters: typing.Optional[typing.Dict[str, typing.Any]] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/src/superagent/types/http_validation_error.py b/src/superagent/types/http_validation_error.py index e5f647b..267b46a 100644 --- a/src/superagent/types/http_validation_error.py +++ b/src/superagent/types/http_validation_error.py @@ -13,7 +13,7 @@ class HttpValidationError(pydantic.BaseModel): - detail: typing.Optional[typing.List[ValidationError]] + detail: typing.Optional[typing.List[ValidationError]] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/src/superagent/types/llm_list.py b/src/superagent/types/llm_list.py index 9e88939..c4d1cb5 100644 --- a/src/superagent/types/llm_list.py +++ b/src/superagent/types/llm_list.py @@ -14,7 +14,7 @@ class LlmList(pydantic.BaseModel): success: bool - data: typing.Optional[typing.List[PrismaModelsLlm]] + data: typing.Optional[typing.List[PrismaModelsLlm]] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/src/superagent/types/llm_params.py b/src/superagent/types/llm_params.py index 82802ca..85f1a2d 100644 --- a/src/superagent/types/llm_params.py +++ b/src/superagent/types/llm_params.py @@ -12,8 +12,8 @@ class LlmParams(pydantic.BaseModel): - max_tokens: typing.Optional[int] - temperature: typing.Optional[float] + max_tokens: typing.Optional[int] = None + temperature: typing.Optional[float] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/src/superagent/types/open_ai_assistant_parameters.py b/src/superagent/types/open_ai_assistant_parameters.py index ad51c74..649d53d 100644 --- a/src/superagent/types/open_ai_assistant_parameters.py +++ b/src/superagent/types/open_ai_assistant_parameters.py @@ -13,9 +13,9 @@ class OpenAiAssistantParameters(pydantic.BaseModel): - metadata: typing.Optional[typing.Dict[str, typing.Any]] - file_ids: typing.Optional[typing.List[str]] = pydantic.Field(alias="fileIds") - tools: typing.Optional[typing.List[OpenAiAssistantParametersToolsItem]] + metadata: typing.Optional[typing.Dict[str, typing.Any]] = None + file_ids: typing.Optional[typing.List[str]] = pydantic.Field(alias="fileIds", default=None) + tools: typing.Optional[typing.List[OpenAiAssistantParametersToolsItem]] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/src/superagent/types/open_ai_assistant_parameters_tools_item.py b/src/superagent/types/open_ai_assistant_parameters_tools_item.py index 75a4895..e561140 100644 --- a/src/superagent/types/open_ai_assistant_parameters_tools_item.py +++ b/src/superagent/types/open_ai_assistant_parameters_tools_item.py @@ -4,15 +4,13 @@ import typing -import typing_extensions - from .tool_assistant_tools_code import ToolAssistantToolsCode from .tool_assistant_tools_function import ToolAssistantToolsFunction from .tool_assistant_tools_retrieval import ToolAssistantToolsRetrieval class OpenAiAssistantParametersToolsItem_CodeInterpreter(ToolAssistantToolsCode): - type: typing_extensions.Literal["code_interpreter"] + type: typing.Literal["code_interpreter"] class Config: frozen = True @@ -21,7 +19,7 @@ class Config: class OpenAiAssistantParametersToolsItem_Retrieval(ToolAssistantToolsRetrieval): - type: typing_extensions.Literal["retrieval"] + type: typing.Literal["retrieval"] class Config: frozen = True @@ -30,7 +28,7 @@ class Config: class OpenAiAssistantParametersToolsItem_Function(ToolAssistantToolsFunction): - type: typing_extensions.Literal["function"] + type: typing.Literal["function"] class Config: frozen = True diff --git a/src/superagent/types/prisma_models_agent.py b/src/superagent/types/prisma_models_agent.py index 84d6117..f682b17 100644 --- a/src/superagent/types/prisma_models_agent.py +++ b/src/superagent/types/prisma_models_agent.py @@ -23,21 +23,23 @@ class PrismaModelsAgent(pydantic.BaseModel): id: str type: AgentType name: str - avatar: typing.Optional[str] - initial_message: typing.Optional[str] = pydantic.Field(alias="initialMessage") + avatar: typing.Optional[str] = None + initial_message: typing.Optional[str] = pydantic.Field(alias="initialMessage", default=None) description: str is_active: bool = pydantic.Field(alias="isActive") created_at: dt.datetime = pydantic.Field(alias="createdAt") updated_at: dt.datetime = pydantic.Field(alias="updatedAt") - llms: typing.Optional[typing.List[PrismaModelsAgentLlm]] - llm_model: typing.Optional[LlmModel] = pydantic.Field(alias="llmModel") - prompt: typing.Optional[str] + llms: typing.Optional[typing.List[PrismaModelsAgentLlm]] = None + llm_model: typing.Optional[LlmModel] = pydantic.Field(alias="llmModel", default=None) + prompt: typing.Optional[str] = None api_user_id: str = pydantic.Field(alias="apiUserId") - api_user: typing.Optional[PrismaModelsApiUser] = pydantic.Field(alias="apiUser") - datasources: typing.Optional[typing.List[PrismaModelsAgentDatasource]] - tools: typing.Optional[typing.List[PrismaModelsAgentTool]] - workflow_steps: typing.Optional[typing.List[PrismaModelsWorkflowStep]] = pydantic.Field(alias="workflowSteps") - metadata: typing.Optional[typing.Any] + api_user: typing.Optional[PrismaModelsApiUser] = pydantic.Field(alias="apiUser", default=None) + datasources: typing.Optional[typing.List[PrismaModelsAgentDatasource]] = None + tools: typing.Optional[typing.List[PrismaModelsAgentTool]] = None + workflow_steps: typing.Optional[typing.List[PrismaModelsWorkflowStep]] = pydantic.Field( + alias="workflowSteps", default=None + ) + metadata: typing.Optional[typing.Any] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/src/superagent/types/prisma_models_agent_datasource.py b/src/superagent/types/prisma_models_agent_datasource.py index 1bc0b6b..b8ddd60 100644 --- a/src/superagent/types/prisma_models_agent_datasource.py +++ b/src/superagent/types/prisma_models_agent_datasource.py @@ -20,8 +20,8 @@ class PrismaModelsAgentDatasource(pydantic.BaseModel): agent_id: str = pydantic.Field(alias="agentId") datasource_id: str = pydantic.Field(alias="datasourceId") - agent: typing.Optional[PrismaModelsAgent] - datasource: typing.Optional[PrismaModelsDatasource] + agent: typing.Optional[PrismaModelsAgent] = None + datasource: typing.Optional[PrismaModelsDatasource] = None created_at: dt.datetime = pydantic.Field(alias="createdAt") updated_at: dt.datetime = pydantic.Field(alias="updatedAt") diff --git a/src/superagent/types/prisma_models_agent_llm.py b/src/superagent/types/prisma_models_agent_llm.py index 72ac1ff..90ebb1d 100644 --- a/src/superagent/types/prisma_models_agent_llm.py +++ b/src/superagent/types/prisma_models_agent_llm.py @@ -20,8 +20,8 @@ class PrismaModelsAgentLlm(pydantic.BaseModel): agent_id: str = pydantic.Field(alias="agentId") llm_id: str = pydantic.Field(alias="llmId") - agent: typing.Optional[PrismaModelsAgent] - llm: typing.Optional[PrismaModelsLlm] + agent: typing.Optional[PrismaModelsAgent] = None + llm: typing.Optional[PrismaModelsLlm] = None created_at: dt.datetime = pydantic.Field(alias="createdAt") updated_at: dt.datetime = pydantic.Field(alias="updatedAt") diff --git a/src/superagent/types/prisma_models_agent_tool.py b/src/superagent/types/prisma_models_agent_tool.py index 0a88387..d697dc7 100644 --- a/src/superagent/types/prisma_models_agent_tool.py +++ b/src/superagent/types/prisma_models_agent_tool.py @@ -20,8 +20,8 @@ class PrismaModelsAgentTool(pydantic.BaseModel): agent_id: str = pydantic.Field(alias="agentId") tool_id: str = pydantic.Field(alias="toolId") - agent: typing.Optional[PrismaModelsAgent] - tool: typing.Optional[PrismaModelsTool] + agent: typing.Optional[PrismaModelsAgent] = None + tool: typing.Optional[PrismaModelsTool] = None created_at: dt.datetime = pydantic.Field(alias="createdAt") updated_at: dt.datetime = pydantic.Field(alias="updatedAt") diff --git a/src/superagent/types/prisma_models_api_key.py b/src/superagent/types/prisma_models_api_key.py index 46154a0..f345c34 100644 --- a/src/superagent/types/prisma_models_api_key.py +++ b/src/superagent/types/prisma_models_api_key.py @@ -24,7 +24,7 @@ class PrismaModelsApiKey(pydantic.BaseModel): created_at: dt.datetime = pydantic.Field(alias="createdAt") updated_at: dt.datetime = pydantic.Field(alias="updatedAt") api_user_id: str = pydantic.Field(alias="apiUserId") - api_user: typing.Optional[PrismaModelsApiUser] = pydantic.Field(alias="apiUser") + api_user: typing.Optional[PrismaModelsApiUser] = pydantic.Field(alias="apiUser", default=None) def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/src/superagent/types/prisma_models_api_user.py b/src/superagent/types/prisma_models_api_user.py index bb68a0f..6073d31 100644 --- a/src/superagent/types/prisma_models_api_user.py +++ b/src/superagent/types/prisma_models_api_user.py @@ -19,18 +19,20 @@ class PrismaModelsApiUser(pydantic.BaseModel): """ id: str - token: typing.Optional[str] - email: typing.Optional[str] + token: typing.Optional[str] = None + email: typing.Optional[str] = None created_at: dt.datetime = pydantic.Field(alias="createdAt") updated_at: dt.datetime = pydantic.Field(alias="updatedAt") - agents: typing.Optional[typing.List[PrismaModelsAgent]] - llms: typing.Optional[typing.List[PrismaModelsLlm]] - datasources: typing.Optional[typing.List[PrismaModelsDatasource]] - tools: typing.Optional[typing.List[PrismaModelsTool]] - workflows: typing.Optional[typing.List[PrismaModelsWorkflow]] - vector_db: typing.Optional[typing.List[PrismaModelsVectorDb]] = pydantic.Field(alias="vectorDb") - workflow_configs: typing.Optional[typing.List[WorkflowConfig]] = pydantic.Field(alias="workflowConfigs") - api_keys: typing.Optional[typing.List[PrismaModelsApiKey]] = pydantic.Field(alias="apiKeys") + agents: typing.Optional[typing.List[PrismaModelsAgent]] = None + llms: typing.Optional[typing.List[PrismaModelsLlm]] = None + datasources: typing.Optional[typing.List[PrismaModelsDatasource]] = None + tools: typing.Optional[typing.List[PrismaModelsTool]] = None + workflows: typing.Optional[typing.List[PrismaModelsWorkflow]] = None + vector_db: typing.Optional[typing.List[PrismaModelsVectorDb]] = pydantic.Field(alias="vectorDb", default=None) + workflow_configs: typing.Optional[typing.List[WorkflowConfig]] = pydantic.Field( + alias="workflowConfigs", default=None + ) + api_keys: typing.Optional[typing.List[PrismaModelsApiKey]] = pydantic.Field(alias="apiKeys", default=None) def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/src/superagent/types/prisma_models_datasource.py b/src/superagent/types/prisma_models_datasource.py index d3f583f..fb813f9 100644 --- a/src/superagent/types/prisma_models_datasource.py +++ b/src/superagent/types/prisma_models_datasource.py @@ -22,19 +22,19 @@ class PrismaModelsDatasource(pydantic.BaseModel): id: str name: str - content: typing.Optional[str] - description: typing.Optional[str] - url: typing.Optional[str] + content: typing.Optional[str] = None + description: typing.Optional[str] = None + url: typing.Optional[str] = None type: DatasourceType api_user_id: str = pydantic.Field(alias="apiUserId") - api_user: typing.Optional[PrismaModelsApiUser] = pydantic.Field(alias="apiUser") + api_user: typing.Optional[PrismaModelsApiUser] = pydantic.Field(alias="apiUser", default=None) created_at: dt.datetime = pydantic.Field(alias="createdAt") updated_at: dt.datetime = pydantic.Field(alias="updatedAt") - metadata: typing.Optional[str] + metadata: typing.Optional[str] = None status: DatasourceStatus - datasources: typing.Optional[typing.List[PrismaModelsAgentDatasource]] - vector_db: typing.Optional[PrismaModelsVectorDb] = pydantic.Field(alias="vectorDb") - vector_db_id: typing.Optional[str] = pydantic.Field(alias="vectorDbId") + datasources: typing.Optional[typing.List[PrismaModelsAgentDatasource]] = None + vector_db: typing.Optional[PrismaModelsVectorDb] = pydantic.Field(alias="vectorDb", default=None) + vector_db_id: typing.Optional[str] = pydantic.Field(alias="vectorDbId", default=None) def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/src/superagent/types/prisma_models_llm.py b/src/superagent/types/prisma_models_llm.py index 4e53e9a..a5fa74d 100644 --- a/src/superagent/types/prisma_models_llm.py +++ b/src/superagent/types/prisma_models_llm.py @@ -22,12 +22,12 @@ class PrismaModelsLlm(pydantic.BaseModel): id: str provider: LlmProvider api_key: str = pydantic.Field(alias="apiKey") - options: typing.Optional[typing.Any] - agents: typing.Optional[typing.List[PrismaModelsAgentLlm]] + options: typing.Optional[typing.Any] = None + agents: typing.Optional[typing.List[PrismaModelsAgentLlm]] = None created_at: dt.datetime = pydantic.Field(alias="createdAt") updated_at: dt.datetime = pydantic.Field(alias="updatedAt") api_user_id: str = pydantic.Field(alias="apiUserId") - api_user: typing.Optional[PrismaModelsApiUser] = pydantic.Field(alias="apiUser") + api_user: typing.Optional[PrismaModelsApiUser] = pydantic.Field(alias="apiUser", default=None) def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/src/superagent/types/prisma_models_tool.py b/src/superagent/types/prisma_models_tool.py index 38fdb88..273a269 100644 --- a/src/superagent/types/prisma_models_tool.py +++ b/src/superagent/types/prisma_models_tool.py @@ -24,13 +24,13 @@ class PrismaModelsTool(pydantic.BaseModel): description: str type: ToolType return_direct: bool = pydantic.Field(alias="returnDirect") - metadata: typing.Optional[str] + metadata: typing.Optional[str] = None created_at: dt.datetime = pydantic.Field(alias="createdAt") updated_at: dt.datetime = pydantic.Field(alias="updatedAt") api_user_id: str = pydantic.Field(alias="apiUserId") - api_user: typing.Optional[PrismaModelsApiUser] = pydantic.Field(alias="apiUser") - tools: typing.Optional[typing.List[PrismaModelsAgentTool]] - tool_config: typing.Optional[typing.Any] = pydantic.Field(alias="toolConfig") + api_user: typing.Optional[PrismaModelsApiUser] = pydantic.Field(alias="apiUser", default=None) + tools: typing.Optional[typing.List[PrismaModelsAgentTool]] = None + tool_config: typing.Optional[typing.Any] = pydantic.Field(alias="toolConfig", default=None) def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/src/superagent/types/prisma_models_vector_db.py b/src/superagent/types/prisma_models_vector_db.py index a9ff201..32f3825 100644 --- a/src/superagent/types/prisma_models_vector_db.py +++ b/src/superagent/types/prisma_models_vector_db.py @@ -21,12 +21,12 @@ class PrismaModelsVectorDb(pydantic.BaseModel): id: str provider: VectorDbProvider - options: typing.Optional[typing.Any] - datasources: typing.Optional[typing.List[PrismaModelsDatasource]] + options: typing.Optional[typing.Any] = None + datasources: typing.Optional[typing.List[PrismaModelsDatasource]] = None created_at: dt.datetime = pydantic.Field(alias="createdAt") updated_at: dt.datetime = pydantic.Field(alias="updatedAt") api_user_id: str = pydantic.Field(alias="apiUserId") - api_user: typing.Optional[PrismaModelsApiUser] = pydantic.Field(alias="apiUser") + api_user: typing.Optional[PrismaModelsApiUser] = pydantic.Field(alias="apiUser", default=None) def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/src/superagent/types/prisma_models_workflow.py b/src/superagent/types/prisma_models_workflow.py index 752509f..983b04b 100644 --- a/src/superagent/types/prisma_models_workflow.py +++ b/src/superagent/types/prisma_models_workflow.py @@ -20,13 +20,15 @@ class PrismaModelsWorkflow(pydantic.BaseModel): id: str name: str - description: typing.Optional[str] + description: typing.Optional[str] = None created_at: dt.datetime = pydantic.Field(alias="createdAt") updated_at: dt.datetime = pydantic.Field(alias="updatedAt") - steps: typing.Optional[typing.List[PrismaModelsWorkflowStep]] + steps: typing.Optional[typing.List[PrismaModelsWorkflowStep]] = None api_user_id: str = pydantic.Field(alias="apiUserId") - api_user: typing.Optional[PrismaModelsApiUser] = pydantic.Field(alias="apiUser") - workflow_configs: typing.Optional[typing.List[WorkflowConfig]] = pydantic.Field(alias="workflowConfigs") + api_user: typing.Optional[PrismaModelsApiUser] = pydantic.Field(alias="apiUser", default=None) + workflow_configs: typing.Optional[typing.List[WorkflowConfig]] = pydantic.Field( + alias="workflowConfigs", default=None + ) def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/src/superagent/types/prisma_models_workflow_step.py b/src/superagent/types/prisma_models_workflow_step.py index 5e8e622..ec23f2d 100644 --- a/src/superagent/types/prisma_models_workflow_step.py +++ b/src/superagent/types/prisma_models_workflow_step.py @@ -21,13 +21,13 @@ class PrismaModelsWorkflowStep(pydantic.BaseModel): id: str order: int workflow_id: str = pydantic.Field(alias="workflowId") - workflow: typing.Optional[PrismaModelsWorkflow] + workflow: typing.Optional[PrismaModelsWorkflow] = None created_at: dt.datetime = pydantic.Field(alias="createdAt") updated_at: dt.datetime = pydantic.Field(alias="updatedAt") - input: typing.Optional[str] - output: typing.Optional[str] + input: typing.Optional[str] = None + output: typing.Optional[str] = None agent_id: str = pydantic.Field(alias="agentId") - agent: typing.Optional[PrismaModelsAgent] + agent: typing.Optional[PrismaModelsAgent] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/src/superagent/types/tool_assistant_tools_function.py b/src/superagent/types/tool_assistant_tools_function.py index b14a2b8..90effdd 100644 --- a/src/superagent/types/tool_assistant_tools_function.py +++ b/src/superagent/types/tool_assistant_tools_function.py @@ -13,7 +13,7 @@ class ToolAssistantToolsFunction(pydantic.BaseModel): - function: typing.Optional[FunctionDefinition] + function: typing.Optional[FunctionDefinition] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/src/superagent/types/tool_list.py b/src/superagent/types/tool_list.py index 0f5b4a9..21cf9ba 100644 --- a/src/superagent/types/tool_list.py +++ b/src/superagent/types/tool_list.py @@ -14,7 +14,7 @@ class ToolList(pydantic.BaseModel): success: bool - data: typing.Optional[typing.List[PrismaModelsTool]] + data: typing.Optional[typing.List[PrismaModelsTool]] = None total_pages: int def json(self, **kwargs: typing.Any) -> str: diff --git a/src/superagent/types/vector_db_list.py b/src/superagent/types/vector_db_list.py index 9795827..3a5e858 100644 --- a/src/superagent/types/vector_db_list.py +++ b/src/superagent/types/vector_db_list.py @@ -14,7 +14,7 @@ class VectorDbList(pydantic.BaseModel): success: bool - data: typing.Optional[typing.List[PrismaModelsVectorDb]] + data: typing.Optional[typing.List[PrismaModelsVectorDb]] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/src/superagent/types/workflow_config.py b/src/superagent/types/workflow_config.py index 4dd9a1b..6274413 100644 --- a/src/superagent/types/workflow_config.py +++ b/src/superagent/types/workflow_config.py @@ -19,13 +19,13 @@ class WorkflowConfig(pydantic.BaseModel): """ id: str - config: typing.Optional[typing.Any] + config: typing.Optional[typing.Any] = None created_at: dt.datetime = pydantic.Field(alias="createdAt") updated_at: dt.datetime = pydantic.Field(alias="updatedAt") workflow_id: str = pydantic.Field(alias="workflowId") - workflow: typing.Optional[PrismaModelsWorkflow] - api_user: typing.Optional[PrismaModelsApiUser] = pydantic.Field(alias="ApiUser") - api_user_id: typing.Optional[str] = pydantic.Field(alias="apiUserId") + workflow: typing.Optional[PrismaModelsWorkflow] = None + api_user: typing.Optional[PrismaModelsApiUser] = pydantic.Field(alias="ApiUser", default=None) + api_user_id: typing.Optional[str] = pydantic.Field(alias="apiUserId", default=None) def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/src/superagent/types/workflow_list.py b/src/superagent/types/workflow_list.py index f664013..01d1447 100644 --- a/src/superagent/types/workflow_list.py +++ b/src/superagent/types/workflow_list.py @@ -14,7 +14,7 @@ class WorkflowList(pydantic.BaseModel): success: bool - data: typing.Optional[typing.List[PrismaModelsWorkflow]] + data: typing.Optional[typing.List[PrismaModelsWorkflow]] = None total_pages: int def json(self, **kwargs: typing.Any) -> str: diff --git a/src/superagent/types/workflow_step_list.py b/src/superagent/types/workflow_step_list.py index dc6dcac..cb2f97b 100644 --- a/src/superagent/types/workflow_step_list.py +++ b/src/superagent/types/workflow_step_list.py @@ -14,7 +14,7 @@ class WorkflowStepList(pydantic.BaseModel): success: bool - data: typing.Optional[typing.List[PrismaModelsWorkflowStep]] + data: typing.Optional[typing.List[PrismaModelsWorkflowStep]] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}